DB section has been updated to add some SQL code.
SELECT statements are used to retrieve information from a database.
At National 5 our SELECT statements will have 4 main parts
The fields you want to display in your results
Which tables that the fields are in
The criteria for your search
Any sort order that you want to apply
Show the Title, Date, Days, Capacity and Cost of all courses that cost under £500 and display the results cheapest first.
SELECT Query Design
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
How to Identify the sorting order within a database