SQL Interview Questions
SQL interview questions on queries, joins and aggregation — essential for every backend, data and analytics interview.
Topics
- Query BasicsSELECT, WHERE, JOINs and aggregation — the core SQL every interview expects you to know cold. 5 subtopics
- Subqueries & CTEsScalar, correlated and nested subqueries, IN/EXISTS, derived tables and common table expressions — composing queries out of other queries. 2 subtopics
- Window FunctionsOVER and PARTITION BY, ranking, LAG/LEAD and frame clauses — per-row analytics that keep every row instead of collapsing groups. 3 subtopics
- Schema & Data TypesData types, CREATE/ALTER/DROP, constraints and normalization — designing the tables your queries run against. 4 subtopics
- Modifying DataINSERT, UPDATE, DELETE, UPSERT and views — changing the data and exposing it through saved queries. 2 subtopics
- TransactionsACID, COMMIT/ROLLBACK/SAVEPOINT, isolation levels and locking — keeping data correct when many things happen at once. 2 subtopics
- Indexes & PerformanceIndexes, EXPLAIN, query plans and optimization — why a query is slow and how to make it fast. 2 subtopics
- Built-in FunctionsString, numeric, date and conditional functions — the everyday built-ins for transforming values inside a query. 3 subtopics
- Security & IntegrityGRANT/REVOKE, roles and SQL injection prevention — controlling who can do what and keeping queries safe from untrusted input. 2 subtopics