Memra

Exam-style practice

◈ 3 cards

Mixed, no-scaffold problems — the kind an exam or interview asks.

Prove it

No new concepts — just the real test. Each problem combines several tools you've learned, with no hints in the query shape. Read carefully, decide which features you need, and write it. This is exactly how a database exam or a SQL interview screens you.

Good luck — you've earned this.

the wordingwhat it is asking for"per month", "per genre"GROUP BY that expression"…and keep every row"a window function, OVER ()"above the average"a CTE plus a scalar subquery"the top one per group"ROW_NUMBER in a CTE, keep rnk = 1"that never ordered"LEFT JOIN … IS NULL, or NOT EXISTSDecide collapse-or-keep first. The rest follows.
Exam questions are written in a small vocabulary. Reading the phrase for what it demands — collapse the rows, or keep them — decides the whole shape of the query before you type anything.
NORMAL ~/memra/learn/postgresql/exam-practice utf-8 LF