DataLearning library

SQL and relational databases

Model related data and write queries whose meaning and performance you can explain.

Beginner20 chapters14 practice questions6 references
Start coursePractise questions

Get an in-app notice when new lessons or practice are added.

20 chapters across 7 modules

Course chapters

Explore all 20 chapters in any order. Each chapter has learning goals, a practice prompt, and a primary reference; expanded reading pages are linked from their chapter titles.

01 · Relational foundations4 chapters
  1. Tables, rows, and keys

    • Distinguish a schema from its current rows

    Practice: Model learners and courses with stable identifiers.

    Read the primary referenceLesson guide · Ready
  2. SELECT and filtering

    • Read projection, predicates, and result ordering

    Practice: Query courses by topic and a clear ordering.

    Read the primary referenceLesson guide · Ready
  3. NULL and three-valued logic

    • Use IS NULL and explain unknown comparison results

    Practice: Find missing optional values without using equality to NULL.

    Read the primary referenceLesson guide · Ready
  4. Aggregations and grouping

    • Separate row filtering from group filtering

    Practice: Count completed lessons per learner.

    Read the primary referenceLesson guide · Ready
02 · Relationships and integrity2 chapters
  1. Inner and outer joins

    • Predict which unmatched rows a join retains

    Practice: List learners with and without progress records.

    Read the primary referenceLesson guide · Ready
  2. Constraints and integrity

    • Use primary keys, foreign keys, and checks to preserve rules

    Practice: Prevent duplicate enrollments and invalid completion counts.

    Read the primary referenceLesson guide · Ready
03 · Data changes and modeling2 chapters
  1. INSERT, UPDATE, and DELETE

    • Scope changes and inspect their effects safely

    Practice: Write an update with a precise predicate and rollback plan.

    Read the primary referenceLesson guide · Ready
  2. Normalization

    • Reduce update anomalies while considering access patterns

    Practice: Separate repeated author data from lesson records.

    Read the primary referenceLesson guide · Ready
04 · Querying and performance4 chapters
  1. Subqueries and common-table expressions

    • Break a query into understandable logical stages

    Practice: Compare an existence test with a join.

    Read the primary referenceLesson guide · Ready
  2. Window functions

    • Compute per-group ranks without collapsing rows

    Practice: Rank recent completions within each course.

    Read the primary referenceLesson guide · Ready
  3. Indexes and query plans

    • Connect indexes to filters, ordering, and write overhead

    Practice: Explain why one index helps a common query.

    Read the primary referenceLesson guide · Ready
  4. Transactions and isolation

    • Describe atomicity and anomalies under concurrency

    Practice: Trace a lost-update scenario and a suitable protection.

    Read the primary referenceLesson guide · Ready
05 · Applied data work4 chapters
  1. Pagination and stable order

    • Distinguish offset and keyset pagination tradeoffs

    Practice: Page through lessons with a deterministic tie-breaker.

    Read the primary referenceLesson guide · Ready
  2. Schema migrations

    • Plan compatible changes and validation

    Practice: Add a field without breaking an older application version.

    Read the primary referenceLesson guide · Ready
  3. Database access security

    • Use parameterized queries and least-privilege roles

    Practice: Separate application parameters from SQL syntax.

    Read the primary referenceLesson guide · Ready
  4. Mini project: learning analytics

    • Model and query a small learning dataset

    Practice: Produce accurate completion summaries with edge-case tests.

    Read the primary referenceLesson guide · Ready
06 · Operational database foundations3 chapters
  1. Locks and concurrent updates

    • Connect isolation requirements to lock behavior

    Practice: Trace two transactions updating one inventory row.

    Read the primary referenceLesson guide · Ready
  2. Backups and restoration

    • Distinguish a backup artifact from a verified recovery capability

    Practice: Write a small restore-validation plan with clear data checks.

    Read the primary referenceLesson guide · Ready
  3. Data quality and analytics

    • Handle duplicates, missing values, and time boundaries deliberately

    Practice: Audit a completion-report query against adversarial sample rows.

    Read the primary referenceLesson guide · Ready
07 · Further foundations and worked reasoning1 chapter
  1. Joins and cardinality

    Predict the shape of a query result before trusting its aggregate.

    • Predict how key uniqueness and missing matches affect joined row counts

    Practice: Join two small tables, explain duplicate output rows, and repair an incorrect aggregate.

    Read the primary referenceExpanded reading · Ready

Learn it. Check it. Try again.

14 original questions with worked explanations and source references. Filter by difficulty, revisit mistakes, and save your attempt as you go.

Open SQL and relational databases practice

Books & references

Free reading at the publisher or author’s site. External materials keep their own licenses.