SQL
DDL/DML, JOINs, subqueries, indexes, transactions, isolation levels, locking, window functions, CTEs, query performance, and database design — PostgreSQL, MySQL, SQL Server & Oracle.
Practice interview questions on this topic →SQL Fundamentals — DDL, DML & Constraints
beginnerSQL (Structured Query Language) is the standard language for managing relational databases. Every backend engineer, data engineer, and solution architect must master SQL fundamentals.
SELECT Queries — WHERE, GROUP BY, HAVING, ORDER BY
beginnerThe SELECT statement is the most used SQL statement. Understanding its execution order and clause interactions is critical for writing correct and efficient queries.
JOINs — INNER, LEFT, RIGHT, FULL, SELF, CROSS
beginnerProJOINs combine rows from two or more tables based on a related column. Understanding which JOIN to use and how it executes is fundamental to SQL mastery.
Subqueries, EXISTS & Correlated Subqueries
beginnerProSubqueries are SELECT statements nested within another SQL statement. They can appear in SELECT, FROM, WHERE, and HAVING clauses.
Indexes — Clustered, Non-Clustered, Composite, Covering
beginnerProIndexes are database structures that improve query performance by allowing fast data lookup without full table scans. Understanding indexes is one of the most critical skills for database performance
Transactions — ACID, COMMIT, ROLLBACK, SAVEPOINT
intermediateProA transaction is a logical unit of work that must execute completely or not at all. Transactions ensure database integrity even in the face of errors, crashes, and concurrent access.
Isolation Levels — Dirty Read, Phantom Read, Non-Repeatable Read
intermediateProTransaction isolation levels control how much a transaction is isolated from the effects of other concurrent transactions. There is a fundamental trade-off: higher isolation = fewer anomalies + more l
Locking — Optimistic vs Pessimistic
intermediateProLocking controls concurrent access to data to prevent anomalies. The choice between optimistic and pessimistic locking dramatically affects application design and performance.
Window Functions — ROW_NUMBER, RANK, LEAD, LAG
intermediateProWindow functions perform calculations across rows related to the current row WITHOUT collapsing the result into a single row (unlike GROUP BY aggregates). They are one of the most powerful SQL feature
CTEs — Common Table Expressions & Recursive CTEs
advancedProA Common Table Expression (CTE) is a named temporary result set defined within a WITH clause, available for the duration of the query. CTEs improve readability, enable recursion, and can replace compl
Performance — EXPLAIN ANALYZE, Partitioning & Sharding
advancedProSQL performance optimization is one of the most valuable skills in database work. Understanding how the query planner works, reading execution plans, and applying the right optimization strategy can t
Database Design — Normalization, Denormalization & Multi-Tenant
advancedProDatabase design determines the structure of your data, which affects data integrity, query performance, and maintainability. Good design starts with normalization and strategically denormalizes for pe
PostgreSQL Specifics — MVCC, JSONB & VACUUM
advancedProPostgreSQL has unique features that set it apart from other databases. Understanding these deeply is essential for PostgreSQL users.
Views — Simple View & Materialized View
intermediateProViews let you name a complex query once so everyone reuses the same definition; materialized views take that a step further by physically storing the result, trading freshness for speed.
Set Operators — UNION, INTERSECT, EXCEPT/MINUS
intermediateProSQL's set operators combine the results of two queries by set logic rather than by joining columns — the right tool whenever the question is really "which rows are in either, both, or only one of these two result sets."
Advanced SQL — Stored Procedures, Functions, Triggers & Sequences
advancedProFunctions, procedures, triggers, and sequences let you push logic and guarantees into the database itself, so they hold true no matter which application or code path touches the data.
SQL Fundamentals Deep Dive — Data Types, NULL Handling & Query Execution Order
beginnerProThe data type you pick, how you handle NULL, and the order SQL actually evaluates a query's clauses in are three foundational things that quietly cause a disproportionate share of real-world SQL bugs.