Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Design and Development

Similar presentations


Presentation on theme: "Database Design and Development"— Presentation transcript:

1 Database Design and Development
SQL - SELECT

2 Learning Intention I will learn how to use SQL to SELECT data from a single table.

3 SQL Structured Query Language (SQL) is the language used to manage data in a relational database. Used to perform database operations to SELECT data INSERT data UPDATE data DELETE data

4 SELECTING with SQL The SELECT statement is used to decide which fields are displayed. SELECT is followed by the fields, separated by commas or a * to select all fields e.g. SELECT town, resortType SELECT *

5 SELECTING with SQL The FROM clause is used to specify which database table(s) are needed in the query. e.g. FROM Resort

6 SELECTING with SQL WHERE clause states the criteria which must be met. Followed by the field name, an operator ( <, =, > etc) and the information specifying the criteria. e.g. WHERE resortType = “city”

7 SELECTING with SQL WHERE clause: Criteria on a Text field: use “
e.g. WHERE resortType = “city” Criteria on a Date/Time field: use # e.g. WHERE checkInTime < #15:00#

8 SELECTING with SQL ORDER BY clause used to tell the sort order of the results e.g. ORDER BY town ASC, starRating DESC

9 SELECTING with SQL SELECT field1, field2, field3, etc FROM tableName WHERE fieldName1 = data AND fieldName3 = data ORDER BY field2 ASC, field4 DESC;

10 Example Display the town, resort type and train station details for all resort types of city ordered by town in alphabetical order Field(s) Table(s) Search criteria Sort order town, resortType, trainStation Resort resortType = “city” town ASC

11 Searching with SQL SQL: SELECT town, resortType, trainStation
FROM Resort WHERE resortType = “city” ORDER BY town ASC; ** always end an SQL statement with ;

12 Pupil Task Complete the following: SQL Booklet Tasks 1 - 3

13 Success Criteria I can create SQL SELECT statements to select data from a single table.


Download ppt "Database Design and Development"

Similar presentations


Ads by Google