🗃️ SQL Queries Explained
3 exercises — read SQL SELECT statements and choose the most accurate plain-English description. Covers JOINs, GROUP BY, aggregations, and window functions.
0 / 3 completed
Translating SQL to English
SELECT a, b FROM t→ "retrieve / get / fetch [a] and [b] from [t]"WHERE condition→ "where [condition is true] / filtered to / only for"LEFT JOIN t2 ON ...→ "including all records from [t1], matched to [t2] where possible"GROUP BY col→ "grouped by / for each [col]"HAVING COUNT = 0→ "that have no / where the count is zero"ORDER BY col DESC→ "sorted by [col], highest first / most recent first"
1 / 3
Read this SQL query. Which plain-English description is the most accurate?
SELECT u.name, u.email, COUNT(o.id) AS order_count
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE u.created_at >= '2024-01-01'
GROUP BY u.id, u.name, u.email
HAVING COUNT(o.id) = 0
ORDER BY u.created_at DESC;Option B is the most natural and complete description. It clearly answers: who is selected (users who registered since Jan 2024), what the filter is (no orders), and in what order (most recently registered first). Option A says "orders from 2024" — incorrect, the date filter is on user creation, not orders. Option C is close but "shows those with zero orders" is informal and misses the registration date context as a standalone fact. Option D describes the SQL clauses rather than the business meaning. In technical English, always translate SQL to business meaning: instead of "LEFT JOIN + HAVING COUNT = 0", say "users who have placed no orders".