SQL practice
SQL practice exercises with real data, right in your browser
Reading about SQL is something else than being able to write it. If you really want to learn it, you need lots of practice, with data you can actually do something with.
Lurndo has more than 400 exercises on real datasets: a web shop, a football club, a library, a cycling race. You write your query, run it and see straight away whether the result is right.
Why Lurndo suits you
More than 400 exercises
From your first
SELECTtoJOIN, subqueries,INSERTand window functions, spread over 44 short lessons and extra game modes.Five kinds of tasks
Writing queries, fixing broken queries, filling in gaps, predicting the result and multiple choice. So you practise reading SQL as well as writing it.
Checked on the result
Every correct query counts, not one prescribed answer. Your query is also tested on other data, so typing in fixed values doesn't work.
Always more to practise
A daily challenge, a final test per module, a speedrun against the clock and query golf, where the shortest query wins.
An exercise to start with
The library is looking for thick books for the summer. Show the title and number of pages of the books with more than 400 pages.
Pick your topic
Every module practises one big topic, with a dataset of its own.
- 2Second dayYour second client: Rewind, the video store in Mechelen. You learn to find exactly the rows you're looking for with WHERE, comparisons, AND/OR/NOT, IN, BETWEEN, LIKE and NULL.
- 4Fourth dayYour fourth client: De Trapper bike rental in Bruges. You learn to count, add up and average with COUNT, SUM, AVG, MIN and MAX, and to summarise everything per group with GROUP BY and HAVING.
- 5Fifth dayYour fifth client: football club FC De Kraaien in Lier. You learn to combine tables with keys and JOIN: INNER, LEFT, RIGHT and FULL, with aliases, across several tables and even a table with itself.
- 6Sixth dayYour sixth client: Het Leeslint library in Kortrijk. You learn to query smarter: reshaping text and dates, choosing with CASE, asking questions inside questions with subqueries and EXISTS, and keeping long queries readable with WITH.
Frequently asked questions
How many exercises are there?
More than 400, spread over 44 lessons in 8 modules, plus the daily challenges, final tests, speedruns and query golf.
How does it know whether my query is right?
It compares the result of your query with the right result, on the visible data and on a hidden variant. Any query that gives the right result is correct.
Can I try my query out first?
Yes. "Run" shows the result without it counting. Only "Check" marks your answer.
What if I'm stuck?
Every exercise has hints that get more concrete one by one. After a few tries you may also see the solution, with an explanation.
Ready to practise?
Start with the first lesson, or pick a topic straight away. The first three modules are free.
Start free with the first lesson