Loading…
Loading…
Twenty-four questions on INSERT, UPDATE, DELETE, TRUNCATE, removing duplicates, upserts with ON CONFLICT and ON DUPLICATE KEY UPDATE, MERGE, RETURNING and data-modifying CTEs, with explanations.
Review quiz for Part 7 (Changing data) of the SQL course:
The questions use the shop database from Part 3, and each query runs on a fresh copy of it:
products (7 rows, IDs 1–7): Ridge 2 tent, Summit 4 tent, Glow head torch, Basecamp lantern, Trail 30 backpack, Day 18 backpack and Merino socks (16.00, product 7). The lantern's brand and weight_g are NULL. price and stock are NOT NULL.customers (6 rows): Asha (1), Ben (2), Chen (3), Dana (4), Eli (5) and Farah (6). Asha referred Ben and Chen, Ben referred Dana, and Chen referred Farah (referred_by).orders (6 rows): 101 and 103 by Asha, 102 by Ben, 104 by Chen, 105 by Dana, and the guest order 106 with a NULL customer_id.order_items (9 rows), with foreign keys to orders and products.Every question with a query was run on PostgreSQL 17 to confirm its answer. Aim for at least 17 out of 24 before starting Part 8.
Quiz path: step 6. Take the quizzes in this order, after reading each article.
Previous quiz: Window Functions Review (SQL Part 6)
Next quiz: Data Types and Functions Review (SQL Part 8)
24 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.