Query with SQL
Learn SQL by running it. Write real queries against a seeded database and get graded the instant you hit Run — projection, filtering, joins and grouping.
How this works
Each step gives you a tiny database and a task. Write the SQL, press Run, and it grades your result set in your browser — no account, nothing installed.
run · sql
Return the NAME and CITY of every user.
Hint: Project two columns with SELECT name, city FROM users.
quiz
In `SELECT name, city FROM users`, what do `name, city` control?
SELECT lists the columns to return. Choosing which ROWS come back is the job of WHERE; ordering is ORDER BY.
run · sql
Return the NAMES of users who live in Bogota, sorted A→Z.
Hint: Combine WHERE city = 'Bogota' with ORDER BY name.
run · sql
For every PAID order, return the buyer's NAME and the order AMOUNT.
Hint: JOIN orders to users ON u.id = o.user_id, then filter WHERE o.status = 'paid'.
quiz
What does a JOIN let you do?
A JOIN matches rows across tables on a key (here orders.user_id = users.id) so you can read columns from both at once.
run · sql
Return each buyer's NAME and their TOTAL paid amount (only users who have paid orders).
Hint: Use SUM(o.amount) with GROUP BY u.name over the paid orders.
You can query
You wrote real SELECTs — projection, filtering, joins and grouping — and each one ran against a live database. Your progress is saved in this browser.
✓
Course complete!
You finished this course. Your progress is saved in this browser.