BEGIN, COMMIT, ROLLBACK and Savepoints
Grouping statements into one unit of work that either fully applies or fully undoes. Learn transaction boundaries, savepoints, autocommit and what sil...
A complete SQL path: fundamentals, DDL and DML, querying, joins, subqueries, CTEs, window functions, design, indexing, transactions, performance and security.
91 notes in 31 topics
Grouping statements into one unit of work that either fully applies or fully undoes. Learn transaction boundaries, savepoints, autocommit and what sil...
Atomicity, consistency, isolation and durability - what each guarantee actually promises, how the database delivers it, and where each one can be weak...
The four isolation levels, the three anomalies they prevent, and what each database actually defaults to - with the session by session demonstrations.
How the database stops two transactions corrupting each other: lock modes, granularity, locking reads, and why an unindexed WHERE clause can lock a wh...
Why two transactions can wait for each other forever, how the database resolves it, and the design habits that prevent deadlocks and reduce contention...
An index is a sorted lookup structure the database maintains for you. Learn how a B-tree finds a row, what an index costs, and the clustered index in...
Multi column indexes and why their order decides everything: the leftmost prefix rule, selectivity, covering indexes and index only scans.
Indexes are not free. Learn the cases where the optimiser correctly ignores them, how to find unused and duplicate indexes, and how to maintain them.
What happens between typing a query and getting rows, and how to read an execution plan - the single most useful performance skill in SQL.
What the engine actually does: full scans versus index seeks, nested loop and hash joins, and why a sort or a temporary table appears in your plan.
A practical checklist for making a slow query fast, and the specific fix for deep pagination that no amount of indexing solves.
Why string concatenation lets user input rewrite your query, and why prepared statements make it structurally impossible - with the cases parameters c...