- Executors
-
Learn
Learn Python Runnable examples, NumPy, pandas, and more Learn AI / Machine LearningNeural networks, ML and LLMs from scratch Learn C & C++ Pointers, memory, STL, and modern C++ Learn C#C# basics, OOP, LINQ, async, and .NET exercises Learn MatplotlibLine, bar, scatter and pie charts with live visualizers Learn RustOwnership, traits, error handling, and threads Learn GoSlices, interfaces, goroutines, and channels Python Algorithms Search, sorting, recursion, and visualizers O(n) C & C++ Algorithms Compare algorithms implemented in C and C++ Coding for Kids Learn to code by playing!
- QuizzesNew
- ChallengesNew
- For TeachersNew
- Updates
- Buy me a coffee
SQL INNER JOIN Quiz
This SQL quiz checks the basics of INNER JOIN: how the ON condition matches rows, why unmatched rows disappear and how repeated keys multiply results. You will read short queries, predict their output and pick the right join for a task.
Sample question
Question 1 of 10How many rows does this join return?
CREATE TABLE customers (id INTEGER, name TEXT);
CREATE TABLE orders (id INTEGER, customer_id INTEGER, amount INTEGER);
INSERT INTO customers VALUES (1, 'Ann'), (2, 'Bob'), (3, 'Cy');
INSERT INTO orders VALUES (10, 1, 10), (11, 1, 20), (12, 3, 5);
SELECT COUNT(*)
FROM customers c
JOIN orders o ON o.customer_id = c.id;
Show the answer
B. 3 Each order matches exactly one customer, so the join returns one row per order: 3. Bob has no orders, so an inner join has nothing to pair him with and he adds no rows.
What this quiz covers
- What
INNER JOIN ... ONreturns - Why rows without a match are left out
- Repeated keys and how they multiply rows
- Table aliases and ambiguous column names
USING (column)and the old comma join
Questions people ask
Do I need an account?
No. Anyone can play. Sign in to keep your XP, streak, badges and history.
Can I retake it?
Yes. Your best score is kept, and the questions and answers are shuffled each time.