Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Introduction to SQL
Structured Query
Language
Possible Benefits of a Standard
Relational Language
• Drop table
• Alter table
• create index
• drop index
• Create view
• Drop view
• Create schema
DML options
• Insert
• Delete
• Update
• Select/From/Where
PlayNum Playname
1131 Johnson Age Position
5410 Smith
8366 Gomez
ANDs and ORs
• COUNT
• MIN
• MAX
• SUM
• AVG
COUNT
• SELECT COUNT(*) FROM Order_Line
WHERE Order_Num=1004;
• SELECT COUNT(Prod_Desc) from
Product;
ORDER_LINE
Order_Num Prod_ID Quantity
PRODUCT
Prod_ID Prod_Desc Prod_Price
MIN and MAX
SELECT MIN(Prod_Price) FROM Product
SELECT Prod_Id, Prod_Desc FROM Product
WHERE Prod_Price=
(SELECT MAX(Prod_Price) FROM
Product);
PRODUCT
Prod_ID Prod_Desc Prod_Price
String Comparison
24 Tigers
Between
• Go to Lab
• Sign into MS SQL Server
• Work problems 1 - 10 in Pratt, page
70 - 71