1 JOINs
A JOIN combines rows from two tables on a related key. INNER JOIN keeps matches; LEFT JOIN keeps all left rows. Always specify the ON condition.
SELECT o.id, u.name, o.total
FROM orders o
INNER JOIN users u ON u.id = o.user_id;
JOINs, aggregates with GROUP BY, and subqueries.
A JOIN combines rows from two tables on a related key. INNER JOIN keeps matches; LEFT JOIN keeps all left rows. Always specify the ON condition.
SELECT o.id, u.name, o.total
FROM orders o
INNER JOIN users u ON u.id = o.user_id;
Aggregate functions (COUNT, SUM, AVG, MIN, MAX) summarise groups defined by GROUP BY. Filter groups with HAVING.
SELECT user_id, COUNT(*) AS orders, SUM(total) AS revenue
FROM orders
GROUP BY user_id
HAVING SUM(total) > 100;
A subquery is a query nested inside another — useful for filters that depend on an aggregate.
SELECT name, total
FROM orders
WHERE total > (SELECT AVG(total) FROM orders);
5 tasks across 2 pages — multiple-choice and fill-in (type the answer). Score 70% or higher to earn your certificate.
🔒 Pass the quiz above (70%+) to unlock your downloadable certificate.
Congratulations! Enter your name to generate your certificate.