Databases
SQL from the first SELECT to window functions, plus indexes, transactions, schema design and NoSQL: everything about databases a developer interview asks.
- 01
How relational databases work
Tables, rows and primary keys, how foreign keys model one-to-many and many-to-many relationships, which constraints keep data valid, and what a database does with your SQL. The foundations under every SQL, JPA, Room and Core Data question.
7–30 min beginner Junior & senior
- 02
SQL basics: reading and changing data
SELECT, WHERE, ORDER BY and LIMIT, the order SQL really runs in, why = NULL never matches and NOT IN can return nothing, and INSERT, UPDATE, DELETE and upserts without lost updates or a missing WHERE. The everyday SQL every developer interview assumes.
6–30 min beginner Junior & senior
- 03
Joins: inner, outer, self and anti-joins
How JOIN combines tables, why an order with three items comes back three times, LEFT JOIN and the WHERE clause that quietly turns it into an INNER JOIN, finding rows with no match, self-joins for managers and duplicates, and joining on ranges. The join questions of every SQL interview.
7–30 min beginner Junior & senior
- 04
Aggregation: GROUP BY and HAVING
count, sum, avg, min and max, why count(column) and count(*) differ, one row per group with GROUP BY, the months that vanish from a sales report, WHERE vs HAVING, and finding duplicates and customers who bought every product. Reporting SQL for interviews and real dashboards.
6–30 min beginner Junior & senior
- 05
Subqueries and CTEs
Queries inside queries, correlated subqueries that run once per row, WITH clauses that name each step, a CTE the main query forgot to use, moving rows in one statement, and recursive CTEs for category trees and referral chains, including the one that never ends.
7–35 min intermediate Junior & senior
- 06
Window functions: ranking, running totals and LAG
Aggregates that keep every row with OVER and PARTITION BY, ROW_NUMBER vs RANK vs DENSE_RANK, top N per group, deleting duplicates, running totals that jump on ties, LAG and LEAD, moving averages, and the gaps-and-islands login streak. The SQL that separates mid-level from senior answers.
7–30 min intermediate Junior & senior
- 07
Indexes and query plans
How a B-tree index finds rows in a few page reads, why wrapping a column in a function hides it from the index, composite index column order, partial, expression and covering indexes, and how to read EXPLAIN ANALYZE to see why a query is slow and why the planner sometimes ignores your index.
7–30 min intermediate Junior & senior
- 08
Transactions, isolation and locking
BEGIN, COMMIT and ROLLBACK, what happens after an error inside a transaction, isolation levels and the anomalies each one allows (lost updates, phantoms, write skew), SELECT FOR UPDATE, optimistic locking, deadlocks and SKIP LOCKED job queues. Database-level answers to every concurrency question.
7–30 min intermediate Junior & senior
- 09
Schema design and normalization
One fact in one place, the normal forms in plain words, the comma-separated column that matches the wrong rows, when to copy data on purpose (prices, addresses, counters), jsonb vs EAV for flexible attributes, designing a schema in an interview, and changing a live schema with migrations and expand/contract.
6–35 min intermediate Junior & senior
- 10
NoSQL databases: document, key-value, wide-column and graph
How MongoDB, Redis, DynamoDB, Cassandra and Neo4j store data and what they're good at. Covers embedding vs referencing, the 16 MB document trap, partition and sort keys, one table per query, hot partitions, LSM trees and tombstones, graph traversals, and how to answer "do we need NoSQL for scale?"
9–40 min intermediate Junior & senior
- 11
SQL interview problems
The SQL questions interviews actually ask, solved step by step. Covers a method for any query problem, second highest salary, employees who earn more than their manager, top N per group with ties, the latest row per group, deleting duplicates, login streaks, month-over-month growth and cohort retention, plus the edge cases that interviewers check.
9–40 min intermediate Junior & senior