SQL for data
Query a real database from your first SELECT to joins, grouping and subqueries. Every example runs against a practice shop database right in your browser.
- 5 modules
- 23 lessons
- 132 runnable examples
- Beginner to intermediate
Getting started
Reading data with SELECT.
Summarising data
Counting, adding and grouping.
Combining tables
Joins and set operations.
Changing data
Insert, update and delete safely.
Going further
Subqueries, CASE and more.
Customers in IndiaList the names of customers who live in India. SolvedEasy+30 XPProducts under 40Find the cheaper products and their prices. SolvedEasy+30 XPOut of stockWhich products have run out? SolvedEasy+30 XPCustomers per countryCount customers in each country. SolvedMedium+50 XPAverage salary by departmentSummarise salaries per department. SolvedMedium+50 XPOrders with customer namesJoin orders to customers. SolvedMedium+50 XPOrder totalsAdd up what each order is worth. SolvedHard+80 XPCustomers who never orderedFind customers with no orders at all. SolvedHard+80 XP
SQL quiz
Ten questions drawn at random from 62, with an explanation after every answer. Score 70% to pass; a perfect round earns a badge.
- Treasure Quest
Sail across eight islands. Each one asks a question; lose three hearts and it's back to port.
- Speed Run
Sixty seconds on the clock. Every right answer scores, and a wrong one costs five seconds.
- Code Puzzle
Real code from the lessons, shuffled line by line. Put it back in the right order.