SELECT Statements 1 Table

SELECT statements are used to retrieve information from a database.

At National 5 our SELECT statements will have 4 main parts

  1. The fields you want to display in your results

  2. Which tables that the fields are in

  3. The criteria for your search

  4. Any sort order that you want to apply

SELECT Query - One Condition

Show the Title, Date, Days, Capacity and Cost of all courses that cost under £500 and display the results cheapest first.

SELECT Query Design

SQL Statement Example

When searching for text values you must use ‘speech marks’

You can use logical conditions such as AND, OR and NOT to create more complex queries

SQL Tutorial 1 SELECT Statements using 1 table

1 Sorting.mp4

How to Identify the sorting order within a database