Skip to main content
CodeOath
← All tracks

Track · For students and working professionals

SQL and data modelling

Read and write SQL you can trust: joins, NULL, grouping, subqueries and window functions, built around one Monday-morning report.

Chapters

Chapters 2 to 10 need a plan.

  1. 01Joins: which rows surviveLearn which rows each join keeps or drops, and how the wrong join quietly changes a report's totals, with self joins, non-equi joins and the cross join.About 12 minFree
  2. 02NULL, three-valued logic and groupingLearn what NULL means, how three-valued logic changes WHERE, joins and aggregates, and how COALESCE, NULLIF and GROUP BY deal with missing values.About 12 minLocked: needs a plan
  3. 03HAVING, subqueries and set operationsFilter groups with HAVING, write scalar, column, table and correlated subqueries, choose between EXISTS, IN and JOIN, and combine results with set operations.About 12 minLocked: needs a plan
  4. 04Window functions, CTEs and transactionsRank and total rows with window functions, split a long query into common table expressions, and see what a transaction protects, with the usual mistakes.About 13 minLocked: needs a plan
  5. 05Why indexes exist and how they are builtSee why an index exists, how a B-tree is organised and how clustered and non-clustered indexes differ, starting from a slow pay-band screen.About 12 minLocked: needs a plan
  6. 06Covering and composite indexes, and sortingLearn how a covering index spares the engine trips back to the table, why column order matters in a composite index, and how an index can supply the sort.About 13 minLocked: needs a plan
  7. 07Queries an index can use, and how the optimizer decidesKeep a condition SARGable so an index can be used, see how selectivity steers the optimizer, and read an execution plan to check what it chose.About 13 minLocked: needs a plan
  8. 08Subquery forms, the cost of indexes, and a checklistCompare EXISTS, IN and JOIN on large tables, count what an index costs on every write, know when not to add one, and use a checklist against common mistakes.About 14 minLocked: needs a plan
  9. 09Transactions: all or nothing, valid states and surviving a crashLearn atomicity, consistency and durability on PostgreSQL in a throwaway container, using a box office that sells 400 seats, and the mistakes that recur.About 13 minLocked: needs a plan
  10. 10Isolation: concurrent buyers and locking the last seatSee how concurrent buyers lose updates, oversell the last seat or break a rule through write skew, and how isolation levels, row locks and lock order respond.About 13 minLocked: needs a plan