Test yourself on SQL with exam style questions, marked instantly.
Flashcards that come back just before you would forget them.
A revision plan that remembers what you know and shows what to do next.
See which topics you have nailed and which need another look.
Quiz yourself on SQLGet your flashcardsBuild my revision planTrack my progressPractical SQL Query Examples
Given this Students table:
| StudentID | Name | Age | City | Score |
|---|---|---|---|---|
| 1 | Alice | 15 | London | 85 |
| 2 | Bob | 17 | Manchester | 72 |
| 3 | Charlie | 16 | London | 91 |
| 4 | Diana | 17 | Leeds | 68 |
| 5 | Eve | 15 | London | 95 |
Query 1: All London students
SELECT Name, Age FROM Students WHERE City = "London" -- Returns: Alice (15), Charlie (16), Eve (15)
Query 2: Students aged 16+ sorted by score (highest first)
SELECT Name, Score FROM Students WHERE Age >= 16 ORDER BY Score DESC -- Returns: Charlie (91), Bob (72), Diana (68)
Query 3: London students with score over 90
SELECT * FROM Students WHERE City = "London" AND Score > 90 -- Returns: Charlie (91), Eve (95)
Query 4: Students from London OR Manchester
SELECT Name, City FROM Students WHERE City = "London" OR City = "Manchester" -- Returns: Alice, Bob, Charlie, Eve
Make this stick
Signing in gives access to all PrepWise features.