Home / SQL
17 chaptersFoundations → advanced → projectsProgress sync when signed in

SQL: complete course

Master relational data modeling, querying, joins, aggregation, constraints, indexes, transactions and production database thinking. Every chapter ends with practical projects so you build while you learn.

0%course progress
0/17chapters done
Start course
1Relational databases and SQL~10 min

What you are learning

1 Relational databases and SQL ~10 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
CREATE TABLE courses (id INTEGER PRIMARY KEY, title TEXT NOT NULL);

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
2CREATE TABLE and data types~12 min

What you are learning

2 CREATE TABLE and data types ~12 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
CREATE TABLE students (id INTEGER PRIMARY KEY, name TEXT NOT NULL, age INTEGER, joined_at TIMESTAMP);

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
3INSERT and data changes~14 min

What you are learning

3 INSERT and data changes ~14 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
INSERT INTO courses (id, title) VALUES (1, 'HTML');
UPDATE courses SET title = 'HTML Foundations' WHERE id = 1;

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
4SELECT fundamentals~16 min

What you are learning

4 SELECT fundamentals ~16 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
SELECT id, title FROM courses;

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
5Filtering and sorting~18 min

What you are learning

5 Filtering and sorting ~18 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
SELECT * FROM courses WHERE title LIKE 'HTML%' ORDER BY title ASC;

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
6Aggregate functions~20 min

What you are learning

6 Aggregate functions ~20 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
SELECT COUNT(*) AS total_courses, MAX(id) AS highest_id FROM courses;

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
7GROUP BY and HAVING~22 min

What you are learning

7 GROUP BY and HAVING ~22 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
SELECT level, COUNT(*) AS total FROM courses GROUP BY level HAVING COUNT(*) > 1;

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
8Relationships and foreign keys~24 min

What you are learning

8 Relationships and foreign keys ~24 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
CREATE TABLE progress (student_id INTEGER REFERENCES students(id), course_id INTEGER REFERENCES courses(id), PRIMARY KEY (student_id, course_id));

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
9JOINs~26 min

What you are learning

9 JOINs ~26 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
SELECT students.name, courses.title FROM students JOIN progress ON progress.student_id = students.id JOIN courses ON courses.id = progress.course_id;

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
10Subqueries and CTEs~28 min

What you are learning

10 Subqueries and CTEs ~28 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
WITH completed AS (SELECT course_id FROM progress) SELECT course_id FROM completed;

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
11Views and reusable queries~30 min

What you are learning

11 Views and reusable queries ~30 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
CREATE VIEW course_list AS SELECT id, title FROM courses;
SELECT * FROM course_list;

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
12Indexes and query performance~32 min

What you are learning

12 Indexes and query performance ~32 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
CREATE INDEX idx_courses_title ON courses(title);
EXPLAIN SELECT * FROM courses WHERE title = 'HTML';

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
13Transactions and concurrency~34 min

What you are learning

13 Transactions and concurrency ~34 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
BEGIN;
UPDATE courses SET title = 'CSS' WHERE id = 1;
COMMIT;

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
14Constraints and data integrity~36 min

What you are learning

14 Constraints and data integrity ~36 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
CREATE TABLE users (id INTEGER PRIMARY KEY, email TEXT UNIQUE NOT NULL);
ALTER TABLE progress ADD CONSTRAINT fk_student FOREIGN KEY (student_id) REFERENCES users(id);

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
15Advanced querying~38 min

What you are learning

15 Advanced querying ~38 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
SELECT title, COUNT(*) OVER () AS total_rows FROM courses ORDER BY title;

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
16Database design and application integration~40 min

What you are learning

16 Database design and application integration ~40 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
-- Application query shape
SELECT c.id, c.title, COUNT(p.student_id) AS learners
FROM courses c LEFT JOIN progress p ON p.course_id = c.id
GROUP BY c.id, c.title;

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topNext chapter
17Capstone: production database~42 min

What you are learning

17 Capstone: production database ~42 min is a core part of SQL. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.

How it works

Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.

Practical example

sql
CREATE TABLE enrollments (student_id INTEGER NOT NULL, course_id INTEGER NOT NULL, enrolled_at TIMESTAMP NOT NULL, PRIMARY KEY(student_id, course_id));

Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.

Projects

Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.

  1. Build a focused SQL mini-project
  2. Build a second project combining this chapter with earlier concepts
  3. Rebuild the project without copying the example
Back to topFinish course
Orbit Code · Detailed programming course · Progress can be synced when signed in · · Contact: xyroworkonly@gmail.com
Curriculum note: This course is written as original instructional material informed by current official documentation and reference material. It is not a copy of any documentation.