| SELECT Basics16 questions |
| 1 | Select one column | Easy | — |
| 2 | Arithmetic expression in SELECT | Easy | — |
| 3 | Column order in SELECT | Easy | — |
| 4 | What SELECT * returns | Easy | — |
| 5 | LIMIT rows returned | Easy | — |
| 6 | Selecting a constant value | Easy | — |
| 7 | Column alias with AS | Easy | — |
| 8 | SELECT * vs named columns | Easy | — |
| 9 | Alias without AS keyword | Easy | — |
| 10 | Selecting a numeric literal | Easy | — |
| 11 | DISTINCT on multiple columns | Medium | — |
| 12 | LIMIT with OFFSET | Medium | — |
| 13 | Where column aliases can be used | Medium | — |
| 14 | DISTINCT removes duplicates | Medium | — |
| 15 | Alias in WHERE clause | Medium | — |
| 16 | SELECT without FROM | Hard | — |
| Filtering14 questions |
| 1 | WHERE with != | Easy | — |
| 2 | WHERE with equality | Easy | — |
| 3 | IN operator | Easy | — |
| 4 | WHERE with AND | Easy | — |
| 5 | WHERE with OR | Easy | — |
| 6 | BETWEEN is inclusive on both ends | Medium | — |
| 7 | AND/OR operator precedence | Medium | — |
| 8 | LIKE with % wildcard | Medium | — |
| 9 | NOT IN operator | Medium | — |
| 10 | LIKE with _ wildcard | Medium | — |
| 11 | NOT BETWEEN behavior | Medium | — |
| 12 | NOT IN with NULL in the list | Hard | — |
| 13 | IS NULL vs = NULL | Hard | — |
| 14 | IS NOT NULL filter | Hard | — |
| Sorting15 questions |
| 1 | ORDER BY multiple columns | Easy | — |
| 2 | Alphabetical sort | Easy | — |
| 3 | ORDER BY combined with WHERE | Easy | — |
| 4 | ORDER BY descending | Easy | — |
| 5 | ORDER BY ascending | Easy | — |
| 6 | Multi-column sort with different directions | Easy | — |
| 7 | NULLS FIRST / NULLS LAST | Medium | — |
| 8 | NULL values in ORDER BY | Medium | — |
| 9 | ORDER BY expression | Medium | — |
| 10 | ORDER BY column position | Medium | — |
| 11 | Top-N pattern with ORDER BY and LIMIT | Medium | — |
| 12 | ORDER BY string function | Medium | — |
| 13 | Danger of positional ORDER BY | Medium | — |
| 14 | Bottom-N pattern | Medium | — |
| 15 | Result order without ORDER BY | Hard | — |
| Aggregation13 questions |
| 1 | AVG of a column | Easy | — |
| 2 | SUM of a column | Easy | — |
| 3 | COUNT(*) counts all rows | Easy | — |
| 4 | Aggregate with WHERE | Easy | — |
| 5 | MIN and MAX | Easy | — |
| 6 | COUNT(column) ignores NULLs | Easy | — |
| 7 | MIN on a text column | Easy | — |
| 8 | COUNT with WHERE | Easy | — |
| 9 | COUNT(DISTINCT column) | Medium | — |
| 10 | SUM when all values are NULL | Medium | — |
| 11 | AVG and NULL rows | Medium | — |
| 12 | Mixing aggregate and non-aggregate columns | Hard | — |
| 13 | Valid fix for non-grouped column | Hard | — |
| Grouping12 questions |
| 1 | Basic GROUP BY | Easy | — |
| 2 | GROUP BY multiple columns | Easy | — |
| 3 | COUNT per group | Easy | — |
| 4 | GROUP BY with ORDER BY | Easy | — |
| 5 | Distinct groups with multi-column GROUP BY | Easy | — |
| 6 | Sort grouped results by aggregate value | Easy | — |
| 7 | WHERE filters before grouping | Medium | — |
| 8 | Average per group | Medium | — |
| 9 | Non-grouped column in SELECT | Medium | — |
| 10 | Which SELECT is valid with GROUP BY dept? | Medium | — |
| 11 | HAVING filters after grouping | Medium | — |
| 12 | GROUP BY vs DISTINCT | Hard | — |
| Filtering Groups9 questions |
| 1 | HAVING with COUNT | Easy | — |
| 2 | Basic HAVING clause | Easy | — |
| 3 | WHERE vs HAVING | Easy | — |
| 4 | WHERE and HAVING together | Medium | — |
| 5 | HAVING with MIN | Medium | — |
| 6 | HAVING with alias | Medium | — |
| 7 | HAVING with MAX | Medium | — |
| 8 | Full GROUP BY pipeline | Hard | — |
| 9 | HAVING without GROUP BY | Hard | — |
| Joins19 questions |
| 1 | LEFT JOIN keeps all left rows | Easy | — |
| 2 | INNER JOIN basics | Easy | — |
| 3 | RIGHT JOIN keeps all right rows | Easy | — |
| 4 | What INNER JOIN excludes | Easy | — |
| 5 | ON vs WHERE in a LEFT JOIN | Medium | — |
| 6 | Finding unmatched rows with LEFT JOIN | Medium | — |
| 7 | CROSS JOIN produces a cartesian product | Medium | — |
| 8 | Joining three tables | Medium | — |
| 9 | Non-equi join | Medium | — |
| 10 | Joining on multiple conditions | Medium | — |
| 11 | Order of chained JOINs | Medium | — |
| 12 | Fan-out from single-column join on composite key | Medium | — |
| 13 | FULL OUTER JOIN | Hard | — |
| 14 | NULL in a join key | Hard | — |
| 15 | LEFT JOIN converted to INNER by WHERE | Hard | — |
| 16 | Fan-out from duplicate rows before joining | Hard | — |
| 17 | JOIN vs subquery — when to use each | Hard | — |
| 18 | FULL OUTER JOIN vs LEFT JOIN | Hard | — |
| 19 | Detecting unexpected fan-out | Hard | — |
| Self Joins8 questions |
| 1 | Employee-manager self join | Easy | — |
| 2 | What is a self join? | Easy | — |
| 3 | Self join with LEFT JOIN for hierarchy | Easy | — |
| 4 | Comparing rows within the same table | Medium | — |
| 5 | Two-level hierarchy | Medium | — |
| 6 | Finding pairs in the same group | Medium | — |
| 7 | Why aliases are required in self joins | Hard | — |
| 8 | Chained self joins and missing rows | Hard | — |
| Subqueries15 questions |
| 1 | Scalar subquery in WHERE | Easy | — |
| 2 | Subquery with IN | Easy | — |
| 3 | Subquery with NOT IN | Easy | — |
| 4 | Derived table must be aliased | Easy | — |
| 5 | Scalar subquery in SELECT | Medium | — |
| 6 | Correlated subquery | Medium | — |
| 7 | EXISTS subquery | Medium | — |
| 8 | Scalar subquery in HAVING | Medium | — |
| 9 | Scalar subquery must return one row | Medium | — |
| 10 | EXISTS vs IN - semantic difference | Medium | — |
| 11 | HAVING vs WHERE with subqueries | Medium | — |
| 12 | Subquery in FROM (derived table) | Hard | — |
| 13 | NOT IN subquery with NULLs | Hard | — |
| 14 | Correlated subquery performance | Hard | — |
| 15 | NOT IN vs NOT EXISTS | Hard | — |
| CTEs13 questions |
| 1 | Basic CTE with WITH | Easy | — |
| 2 | Multiple CTEs | Easy | — |
| 3 | CTE vs subquery | Easy | — |
| 4 | CTE referencing a prior CTE | Easy | — |
| 5 | CTE used in a JOIN | Medium | — |
| 6 | CTE scope | Medium | — |
| 7 | CTE referenced multiple times | Medium | — |
| 8 | Recursive CTE concept | Hard | — |
| 9 | Recursive CTE generating a sequence | Hard | — |
| 10 | CTEs and the optimizer | Hard | — |
| 11 | CTE vs temporary table | Hard | — |
| 12 | Recursive CTE - org chart traversal | Hard | — |
| 13 | Forcing CTE materialization | Hard | — |
| CASE Expressions13 questions |
| 1 | Simple CASE (equality form) | Easy | — |
| 2 | Basic CASE WHEN | Easy | — |
| 3 | Multiple WHEN branches | Easy | — |
| 4 | CASE as a replacement for nested IFs | Easy | — |
| 5 | Conditional aggregation with CASE | Medium | — |
| 6 | CASE with no ELSE | Medium | — |
| 7 | CASE in ORDER BY | Medium | — |
| 8 | COUNT with conditional CASE | Medium | — |
| 9 | CASE WHEN NULL - equality vs IS NULL | Medium | — |
| 10 | Pivoting rows to columns with CASE | Medium | — |
| 11 | CASE in GROUP BY | Medium | — |
| 12 | When to use CASE pivot vs PIVOT keyword | Medium | — |
| 13 | CASE and NULL | Hard | — |
| Set Operations10 questions |
| 1 | INTERSECT returns common rows | Easy | — |
| 2 | UNION ALL keeps duplicates | Easy | — |
| 3 | EXCEPT removes rows found in the second set | Easy | — |
| 4 | UNION removes duplicates | Easy | — |
| 5 | EXCEPT with no remaining rows | Easy | — |
| 6 | INTERSECT vs inner join | Easy | — |
| 7 | Column count in UNION | Medium | — |
| 8 | ORDER BY with UNION | Medium | — |
| 9 | UNION vs JOIN | Hard | — |
| 10 | Choosing UNION or JOIN for a real scenario | Hard | — |
| Window Functions22 questions |
| 1 | PARTITION BY | Easy | — |
| 2 | ROW_NUMBER basics | Easy | — |
| 3 | RANK vs ROW_NUMBER on ties | Medium | — |
| 4 | Running total with ORDER BY in OVER | Medium | — |
| 5 | DENSE_RANK has no gaps | Medium | — |
| 6 | SUM as a window function | Medium | — |
| 7 | NTILE divides rows into buckets | Medium | — |
| 8 | Window function vs GROUP BY | Medium | — |
| 9 | LAG with offset > 1 | Medium | — |
| 10 | Multiple window functions in one query | Medium | — |
| 11 | NTILE with uneven bucket sizes | Medium | — |
| 12 | Named windows with the WINDOW clause | Medium | — |
| 13 | Can you mix window functions and GROUP BY? | Medium | — |
| 14 | LAG to access the previous row | Hard | — |
| 15 | Top-N per group with window functions | Hard | — |
| 16 | PERCENT_RANK | Hard | — |
| 17 | ROWS BETWEEN frame clause | Hard | — |
| 18 | NULLs in window ORDER BY | Hard | — |
| 19 | FIRST_VALUE and LAST_VALUE | Hard | — |
| 20 | Top-N per group: why a subquery is needed | Hard | — |
| 21 | Why LAST_VALUE surprises developers | Hard | — |
| 22 | ROWS vs RANGE frame modes | Hard | — |
| Date Filtering13 questions |
| 1 | Filter by exact date | Easy | — |
| 2 | Filter with date comparison operators | Easy | — |
| 3 | BETWEEN inclusivity on date boundaries | Easy | — |
| 4 | Equality on a date column with no match | Easy | — |
| 5 | Less-than date comparison | Easy | — |
| 6 | Filtering relative to today | Medium | — |
| 7 | Filtering timestamps within a day | Medium | — |
| 8 | Filter by year or month using EXTRACT | Medium | — |
| 9 | CURRENT_DATE vs NOW() for date filtering | Medium | — |
| 10 | EXTRACT for day-of-week filtering | Medium | — |
| 11 | Filtering NULL dates | Hard | — |
| 12 | Index-friendly date filtering | Hard | — |
| 13 | IS NOT NULL on a date column | Hard | — |
| Date Functions12 questions |
| 1 | EXTRACT a date part | Easy | — |
| 2 | Difference between two dates | Easy | — |
| 3 | Date arithmetic with intervals | Easy | — |
| 4 | Getting the current date and time | Easy | — |
| 5 | EXTRACT month and day | Easy | — |
| 6 | NOW() vs CURRENT_TIMESTAMP | Easy | — |
| 7 | Filtering by date range | Medium | — |
| 8 | Grouping by month | Medium | — |
| 9 | DATE_TRUNC truncates to a precision | Medium | — |
| 10 | Calculating age or elapsed time | Hard | — |
| 11 | TIMESTAMP vs TIMESTAMPTZ | Hard | — |
| 12 | Inclusive vs exclusive upper bound in date ranges | Hard | — |
| String Functions15 questions |
| 1 | String concatenation | Easy | — |
| 2 | SUBSTRING extraction | Easy | — |
| 3 | LENGTH of a string | Easy | — |
| 4 | UPPER and LOWER | Easy | — |
| 5 | REPLACE all occurrences | Easy | — |
| 6 | TRIM removes whitespace | Easy | — |
| 7 | LENGTH with spaces | Easy | — |
| 8 | UPPER on mixed case | Easy | — |
| 9 | LTRIM vs RTRIM | Easy | — |
| 10 | REPLACE with no match | Easy | — |
| 11 | POSITION finds a substring | Medium | — |
| 12 | LEFT and RIGHT | Medium | — |
| 13 | Concatenation with NULL | Medium | — |
| 14 | POSITION when substring is absent | Medium | — |
| 15 | Case-insensitive LIKE search | Hard | — |
| Distinct8 questions |
| 1 | DISTINCT on multiple columns | Easy | — |
| 2 | DISTINCT on one column | Easy | — |
| 3 | COUNT(DISTINCT column) | Medium | — |
| 4 | DISTINCT treats NULLs as equal | Medium | — |
| 5 | DISTINCT vs GROUP BY for unique values | Medium | — |
| 6 | DISTINCT applies to all selected columns | Hard | — |
| 7 | DISTINCT inside an aggregate | Hard | — |
| 8 | DISTINCT cannot use aggregates | Hard | — |