Watching someone build a query step by step feels like understanding. Nodding along as each clause is explained feels like learning. Neither tells you whether you could write that query yourself from a blank editor. That is the difference between a SQL quiz and a tutorial: a tutorial shows you the answer, a quiz makes you produce it.
The best results come from using both, in a specific order. This guide shows why, gives three sample quiz questions with explanations, and explains how a wrong answer tells you exactly what to study next.
In this guide
The gap tutorials do not show you
When you follow along, you are never the one deciding which JOIN to use, whether a problem needs a window function or a plain GROUP BY, or whether HAVING or WHERE is correct. That decision is the actual skill. Recognising a technique while someone points at it is not the same as recalling it cold, and recall is what gets tested in an interview or on a messy dataset at work.
Tutorial vs quiz vs writing queries
| Tutorial | Quiz | Writing queries | |
|---|---|---|---|
| What you do | Read or watch | Answer questions | Write and run SQL |
| What it trains | Recognition | Recall and choosing a technique | Building a solution end to end |
| Feedback | None unless you test yourself | Immediate, per question | The database's result and errors |
| Weakness | Feels like learning without proof | Cannot replace real query writing | Slow to cover many topics |
| Best used for | Meeting a new concept | Finding gaps, rehearsing recall | Making a skill stick |
They are not competitors. Each covers a weakness of the others.
Why recall beats re-reading
Learning research has a well-known finding, often called the testing effect or retrieval practice: trying to recall something strengthens memory more than re-reading it does. The effort of pulling an answer out of your head is part of what makes it stick. That is why an untimed read-through can leave you confident and unprepared, while a few honest quiz questions show you what you actually know.
Three sample SQL quiz questions
This is the style of question a good quiz asks: not “define a JOIN”, but “what happens here?” Try each before opening the answer. They use these tables:
| customer_id | name | phone |
|---|---|---|
| 1 | Asha | 9000000001 |
| 2 | Ravi | 9000000002 |
| 3 | Meera | NULL |
| 4 | Kabir | 9000000004 |
| order_id | customer_id | amount |
|---|---|---|
| 101 | 1 | 500 |
| 102 | 1 | 300 |
| 103 | 2 | 700 |
Want to run this yourself? Copy the setup SQL
CREATE TABLE customers (customer_id INT, name VARCHAR(30), phone VARCHAR(15));
INSERT INTO customers VALUES (1, 'Asha', '9000000001'), (2, 'Ravi', '9000000002'), (3, 'Meera', NULL), (4, 'Kabir', '9000000004');
CREATE TABLE orders (order_id INT, customer_id INT, amount INT);
INSERT INTO orders VALUES (101, 1, 500), (102, 1, 300), (103, 2, 700);Works in MySQL, PostgreSQL and SQLite. Paste it into any of them, then run the queries from this guide.
Question 1
What does this query return?
SELECT c.name, o.order_id, o.amount
FROM customers c
LEFT JOIN orders o ON o.customer_id = c.customer_id
WHERE o.amount > 400;
- All 4 customers, with NULL for those who have no matching order
- Only Asha and Ravi
- Asha and Ravi, plus Meera and Kabir with NULLs
- An error
Show the answer
B. This is a LEFT JOIN, but the WHERE o.amount > 400 runs after the join. Meera and Kabir have NULL amounts, and NULL is never greater than 400, so they are removed. The LEFT JOIN behaves like an INNER JOIN.
| name | order_id | amount |
|---|---|---|
| Asha | 101 | 500 |
| Ravi | 103 | 700 |
Question 2
You want customers who have placed more than 5 orders. Which clause holds the condition COUNT(*) > 5?
WHEREHAVINGONORDER BY
Show the answer
B, HAVING. WHERE filters individual rows before grouping, so no count exists yet. HAVING filters groups after GROUP BY. See WHERE vs HAVING.
Question 3
What does this return for the customers table above?
SELECT COUNT(phone)
FROM customers;
- 4
- 3
- 0
- NULL
Show the answer
B, 3. COUNT(column) counts only rows where the column is not NULL. Meera has no phone, so she is skipped. COUNT(*) would return 4. See NULL in SQL.
| COUNT(phone) |
|---|
| 3 |
What a wrong answer tells you
Instead of a vague feeling that you “get SQL now”, a wrong answer points at a specific topic:
| If you got wrong | You probably need to review | Read |
|---|---|---|
| Which rows a JOIN keeps or drops | INNER vs LEFT JOIN, filtering a LEFT JOIN | SQL Joins Explained |
| WHERE vs HAVING | The order SQL runs clauses in | SQL WHERE vs HAVING |
| A count or average that is off | NULL handling | NULL in SQL |
| Ranking or ties | RANK, DENSE_RANK, ROW_NUMBER | SQL Window Functions |
| Nested or multi-step queries | Subqueries and CTEs | Subquery vs CTE |
Concrete beats vague every time you are deciding what to study next.
How to combine them
Use quizzes as a checkpoint, not a replacement:
- Learn one topic from a tutorial, guide or course.
- Quiz yourself on just that topic before moving on, instead of saving it all for one big test where it is hard to tell which piece broke.
- Review every wrong answer and read the explanation.
- Write a fresh query on the topic from a blank editor in our free SQL editor.
- Come back later and retake the topic. Spaced recall is what makes it last.
Our SQL quiz is built for this: free with a quick sign-in, every quiz is timed and scored, and every answer comes with a written explanation. Once you are comfortable with the basics, follow the SQL interview prep plan.
Frequently asked questions
Is a SQL quiz enough to learn SQL?
No. A quiz shows what you know and what you do not. To actually build the skill you still need to learn concepts and write queries yourself. Use the quiz to decide what to study and to check that it stuck.
Should I time myself when practising SQL questions?
Start untimed while a topic is new, so you can think it through. Once it feels familiar, add a timer, because interviews and screening tests are timed and recall under a clock feels different.
How many SQL quiz questions should I do a day?
There is no magic number. A short daily session, even 5 to 10 questions with careful review of every wrong answer, beats an occasional long marathon.
What topics should a good SQL quiz cover?
Joins, filtering, grouping and HAVING, NULL handling, subqueries and CTEs, window functions and the tricky edge cases in each. Mixed questions also train you to recognise which technique a problem needs.
Are quizzes or tutorials better for beginners?
Start with a tutorial or guide to meet a concept, then quiz yourself on it straight away. Beginners who only watch tutorials often overestimate what they can do.
Related reading
- How to Prepare for a SQL Interview – a plan that uses quizzes well.
- SQL Interview Questions and Answers – nine questions to test yourself on.
- How to Learn SQL: A Practical Roadmap – where quizzes fit at each stage.
Test yourself
Free SQL quiz with a quick sign-in. Timed, scored, with an explanation for every answer.
Practise hands-on instead?
A free SQL editor in your browser. Write real queries with no install.