SQL Placement Quiz

Updated · 7 min read
easyPostgreSQL 18sqlquizplacementassessment

Before a swimming coach puts a new swimmer in a lane, they watch them swim one length. A minute later they know whether to start with the basics, polish what the swimmer already does, or move straight to racing technique. This quiz does the same for SQL. It has 20 questions in four sections of five, and it gives you two results: a track from your total score, and a list of modules to study first for any section where you scored low. It takes about ten minutes.

The Three Tracks

TrackWho it suitsWhere to start
LearnNew to SQL, or you only copy queries from othersWhat Is a Database, then lesson by lesson
RefreshYou write SQL but want to be sure of the tricky partsThe 16-lesson Refresh path, starting with NULL Values
Deep DiveYou're confident and want to know how the engine worksThe Under the hood sections, starting with How a Query Runs

Analysts who mostly read data and build reports can follow the Analyst path whatever their score; it ends with the SQL Analyst Test.

The Quiz

Questions 1 to 5 are about querying, 6 to 10 design, 11 to 15 analytics, and 16 to 20 internals and safety. The questions use the Fee Tracker from The Fee Tracker Database.

SQL placement quiz

20 questions
1Which clause filters rows before they are grouped?
2What does SELECT count(email) FROM students; count?
3WHERE email = NULL returns:
4A LEFT JOIN from students to payments, with WHERE payments.amount_usd > 100, returns students who:
5WHERE course_id NOT IN (1, 2, NULL) returns:
6An enrollments table stores course_title and course_fee on every row. What problem does this cause?
7A student can take many courses, and a course has many students. How is this modeled?
8The best type for a course fee in dollars and cents is:
9payments.student_id references students with ON DELETE CASCADE. Deleting a student:
10A primary key column must be:
11Which keeps duplicate rows?
12Which function gives tied rows the same number and leaves no gaps afterward?
13How does sum(amount_usd) OVER (PARTITION BY student_id) differ from GROUP BY student_id?
14GROUP BY ROLLUP (state, city) adds:
15Which gives a running total of payments by date?
16Which isolation level prevents dirty reads but still allows non-repeatable reads?
17An index on paid_on most likely can't be used for:
18The safest way to put a user's search text into a query from application code is:
19EXPLAIN ANALYZE on a query:
20In PostgreSQL, one session has an open, uncommitted UPDATE on some rows. Another session runs a SELECT on the same rows. It:

Your Section Scores

After submitting, count your correct answers in each section of five. For any section where you got 2 or fewer right, study its lessons first, whatever track the quiz suggested:

Example: a developer scores 13 (Refresh) but only 1 in Design. They follow the Refresh path, and read the Design lessons first.

What to Do Next

Was this tutorial helpful?