SQL and relational databases
Model related data and write queries whose meaning and performance you can explain.
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.
No matching chapters. Try another term.
01 · Relational foundations4 chapters
Tables, rows, and keys
- Distinguish a schema from its current rows
Practice: Model learners and courses with stable identifiers.
Read the primary referenceLesson guide · ReadySELECT and filtering
- Read projection, predicates, and result ordering
Practice: Query courses by topic and a clear ordering.
Read the primary referenceLesson guide · ReadyNULL 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 · ReadyAggregations 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
Inner and outer joins
- Predict which unmatched rows a join retains
Practice: List learners with and without progress records.
Read the primary referenceLesson guide · ReadyConstraints 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
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 · ReadyNormalization
- 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
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 · ReadyWindow functions
- Compute per-group ranks without collapsing rows
Practice: Rank recent completions within each course.
Read the primary referenceLesson guide · ReadyIndexes 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 · ReadyTransactions 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
Pagination and stable order
- Distinguish offset and keyset pagination tradeoffs
Practice: Page through lessons with a deterministic tie-breaker.
Read the primary referenceLesson guide · ReadySchema migrations
- Plan compatible changes and validation
Practice: Add a field without breaking an older application version.
Read the primary referenceLesson guide · ReadyDatabase access security
- Use parameterized queries and least-privilege roles
Practice: Separate application parameters from SQL syntax.
Read the primary referenceLesson guide · ReadyMini 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
Locks and concurrent updates
- Connect isolation requirements to lock behavior
Practice: Trace two transactions updating one inventory row.
Read the primary referenceLesson guide · ReadyBackups 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 · ReadyData 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
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 practiceBooks & references
Free reading at the publisher or author’s site. External materials keep their own licenses.
- PostgreSQL TutorialPostgreSQL Global Development Group · documentation
Source & reuse terms
Freely readable at the provider. This catalog supplies a reference link; no permission to mirror the content is asserted.
- SQL as Understood by SQLiteSQLite authors · documentation
Source & reuse terms
Freely readable at the provider. This catalog supplies a reference link; no permission to mirror the content is asserted.
- SQLBolt interactive SQL lessonsSQLBolt authors · course
Source & reuse terms
Freely readable at the provider. This catalog supplies a reference link; no permission to mirror the content is asserted.
- PostgreSQL IndexesPostgreSQL Global Development Group · documentation
Source & reuse terms
Freely readable at the provider. This catalog supplies a reference link; no permission to mirror the content is asserted.
- PostgreSQL Concurrency ControlPostgreSQL Global Development Group · documentation
Source & reuse terms
Freely readable at the provider. This catalog supplies a reference link; no permission to mirror the content is asserted.
- freeCodeCamp curriculumfreeCodeCamp · course
Source & reuse terms
Free learning site. Curriculum structure verified through its public contributor guide because the learning app is client-rendered. Link to the original; code and curriculum licenses must be checked separately before reuse.