Courses
SQL Intermediate: Queries That Survive Real Data
Final Check: SQL Intermediate
Fifteen scenario questions across the whole course. If you get twelve or more right, you can build reports on messy data, design tables that protect themselves and read what a query is doing.
Course content
Join this Course
Sign in to save your progress.
-
Joins Beyond the Basics
-
Three-Table Joins Without Double Counting
-
Subqueries, EXISTS and IN: Which One When
-
-
-
Thinking in Sets
-
CTEs: Break a Long Query Into Named Steps
-
UNION, INTERSECT and EXCEPT
-
-
-
Windows and Dates
-
Window Functions: ROW_NUMBER, RANK and Running Totals
-
Dates, Times and Time Zones in PostgreSQL
-
-
-
Schema Design That Holds
-
Normalization: Where to Split and Where to Stop
-
UNIQUE, CHECK and Foreign Key Actions
-
-
-
Indexes and Transactions
-
Indexes and EXPLAIN: Why That Query Is Slow
-
Transactions and What Two Users Can See
-
-
- Final Check: SQL Intermediate
1.
You join orders to order_items and run count star to count orders. There are 12 orders and the result is 20. What should you count instead?
2.
Which query is the most reliable way to list customers who have never placed an order?
3.
How do you write two CTEs in one statement?
4.
You UNION two queries, and the row count is lower than the sum of the two. Why?
5.
Which window function gives you the value from the previous row in the same partition?
6.
A column visited_at holds timestamptz values. Which expression gives the day each visit belongs to in Manila?
7.
A BETWEEN '2026-09-01' AND '2026-09-30' filter on a timestamp column misses visits from the afternoon of 30 September. What range is safe?
8.
In a time zone that moves its clocks forward on one day, what is the difference between adding INTERVAL '1 day' and INTERVAL '24 hours' to a timestamptz?
9.
A customer's city is stored on every order row, and someone updates only one of her three orders. What is the design problem?
10.
When is a copy of a value in another table a good design?
11.
What is the main risk of ON DELETE CASCADE on a foreign key?
12.
What is the cost of adding an index to a table?
13.
You want to see the plan of an UPDATE with EXPLAIN ANALYZE. How do you do it safely?
14.
A transaction has been left open for hours after an UPDATE of one row. What do other sessions experience?
15.
An application running at REPEATABLE READ gets the error could not serialize access due to concurrent update. What should it do?
About
Fifteen scenario questions across the whole course. If you get twelve or more right, you can build reports on messy data, design tables that protect themselves and read what a query is doing.
- Duration
- 15 min
- Last update
- 09/26/2026
Was this helpful?
0
0
Comments (0)
Sign in to commentNo comments yet.