Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 SQL Chapter 9 – 8 th edition With help from Chapter 2 – 10 th edition.

Similar presentations


Presentation on theme: "1 SQL Chapter 9 – 8 th edition With help from Chapter 2 – 10 th edition."— Presentation transcript:

1 1 SQL Chapter 9 – 8 th edition With help from Chapter 2 – 10 th edition

2 2 SQL Is not a complete programming language Is a data sublanguage Used in Microsoft Access when you –create a form –create a report –run a query Access generates SQL and sends it to –Jet which is Access’ internal DBMS engine

3 3 Tables on page 237 STUDENT ENROLLMENT CLASS

4 4 Projections using SQL SELECT FROM Note: don’t confuse the keyword SELECT with the relational algebra operator selection

5 5 SELECT Is an SQL verb than can be used to perform a relational algebra –projection –selections –other actions Note: Selection differs from SELECT because it is the relational algebra operation of obtaining a subset of rows from a table.

6 6 SELECT doesn’t automatically remove duplicate rows use keyword DISTINCT if you want duplicate rows removed

7 7 Selection using SELECT SELECT FROM WHERE

8 8 Selection of all SELECT * FROM WHERE

9 9 Selection SELECT FROM WHERE

10 10 WHERE clause can have multiple conditions WHERE AND

11 11 WHERE clause can refer to a set of values WHERE IN [value1, value2,…]

12 12 WHERE can use BETWEEN which is inclusive of endpoints WHERE BETWEEN AND

13 13 LIKE

14 14 Other possibilities missing values are looked for using IS NULL single column sorting is done using ORDER BY multiple column sorting is done using ORDER BY

15 15 SQL Built-in Functions COUNT (*) COUNT

16 16


Download ppt "1 SQL Chapter 9 – 8 th edition With help from Chapter 2 – 10 th edition."

Similar presentations


Ads by Google