This study notes covers SQL Commands within SQL for GCSE Computer Science. Revise SQL in 3.7 Relational Databases and SQL for GCSE Computer Science with 19 exam-style questions and 10 flashcards. This topic shows up very often in GCSE exams, so students should be able to explain it clearly, not just recognise the term. It is section 4 of 9 in this topic. Use this study notes to connect the idea to the wider topic before moving on to questions and flashcards.
SQL Commands
| Command | Purpose | Example |
|---|---|---|
| SELECT | Choose columns to display | SELECT name, age |
| FROM | Specify the table | FROM Students |
| WHERE | Filter rows by condition | WHERE age > 16 |
| ORDER BY | Sort results | ORDER BY name ASC |
| AND / OR | Multiple conditions | WHERE age > 16 AND city = "London" |
| * (wildcard) | Select all columns | SELECT * |
Practice questions for SQL
Which SQL keyword is used to choose which columns to retrieve from a database table?
Explain the difference between using AND and OR to combine conditions in an SQL WHERE clause. Give an example of when each would be used.