Loading…
Loading…
Twenty-seven questions on inner, outer, self, cross and non-equi joins, ON versus WHERE, USING, UNION, INTERSECT and EXCEPT, semi-joins and anti-joins with EXISTS and NOT IN, fan-out and comparing tables, with explanations.
Review quiz for Part 3 (Combining Tables) of the SQL course:
The questions use the shop database from Part 3:
customers (6 rows): Asha (1), Ben (2), Chen (3), Dana (4), Eli (5) and Farah (6). Eli and Farah have no orders, and Farah's city is NULL. referred_by holds the referring customer's ID.orders (6 rows): 101 and 103 by Asha, 102 by Ben, 104 by Chen (pending), 105 by Dana (cancelled), and 106, a guest order with a NULL customer_id. Orders 101, 102 and 106 are shipped and 103 is delivered.order_items (9 rows): order 101 has 2 lines, 103 has 3 lines, and the other orders have 1 line each. The Basecamp lantern (product 4) has never been ordered.payments (4 rows): order 101 was paid in two instalments (150.00 and 147.99), and orders 102 and 103 in one payment each.products: the 7 products from Part 2.Every question with a query was run on PostgreSQL 17 to confirm its answer. Aim for at least 19 out of 27 before starting Part 4.
Quiz path: step 2. Take the quizzes in this order, after reading each article.
Previous quiz: Relational Basics and Single-Table Queries (SQL Parts 1 and 2)
Next quiz: Aggregation Review (SQL Part 4)
27 questions · pass at 68%
Check your understanding; you see the answers and explanations after submitting.
Discussion
Sign in to ask a question or share what you learned.