Lab%209%20-%20Introduction%20to%20Structured%20Query%20Language

Lab%209%20-%20Introduction%20to%20Structured%20Query%20Language

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
INTRODUCTION TO STRUCTURED QUERY LANGUAGE LAB 9
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 TWO WAYS TO QUERY DATA  IN RELATIONAL DBMS Query By Example (QBE). Easy user interface. Different in every database. Structured Query Language (SQL). Developed as part of relational database movement in 70s. ANSI standard. Supported by most databases. Very similar in all systems.
Background image of page 2
3 SQL FUNCTIONALITY Querying Data: List data from tables. Calculate from the data. Summarize data. Combine data from multiple tables using table relationships. Data Manipulation Language (DML): Insert Records. Update Records. Delete Records. Data Definition Language (DDL): Add/Drop tables. Add/Drop relationships. Add/Drop indexes. Set Security.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 WHY LEARN SQL WHEN  QBE WORKS AS WELL?  While QBE varies widely among databases  systems, SQL, as an ANSI standard, varies only  slightly. Some Kinds of Database Queries Require SQL. SQL is a Job Skill. Database administrators use SQL as the primary  language for manipulating the database. Programmers use SQL to communicate with the  database in their web programming or client-server  programming applications. IS professionals and managers query corporate data  with SQL-like interface.
Background image of page 4
5 HOW TO ENTER SQL IN ACCESS Launch Access. Load Northwind (or other) Database. Click on Queries. Double-click on Create query in Design view. In the Show Tables dialog, click Close. Click SQL button in the toolbar.  Type SQL. Click       to run. Optionally, save with File | Save As.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 BASIC STRUCTURE OF  SQL COMMAND SELECT FROM WHERE ORDER BY SELECT field or fields FROM table WHERE criteria ORDER BY field or fields
Background image of page 6
7 SELECT FROM SYNTAX Select From SELECT Field | Field, Field, Field | * FROM Table List the CompanyName of all Suppliers Select CompanyName From Suppliers List the CompanyName and Phone number of all Suppliers Select CompanyName, Phone From Suppliers List all the information on every Supplier Select * From Suppliers
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 SELECT FROM (CONT.) Select *  From shippers Use * only when you want to see all columns of a table ShipperID CompanyName Phone 1 Speedy Express (503) 555-9831 2 United Package (503) 555-3199 3 Federal Shipping (503) 555-9931 SQL is generally not case-sensitive.
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 26

Lab%209%20-%20Introduction%20to%20Structured%20Query%20Language

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online