HARVARD-CS50 COURSE GUIDE

CS50 Introduction to Databases with SQL

A chapter-by-chapter readback of the free course by Carter Zenke on freeCodeCamp.org.

Length11:08:48
Chapters10
Modules2
Plain Markdown with clickable timestamps — drops into Obsidian, Notion or GitHub as-is.

The course builds database design concepts from a real relational example: Booker Prize books, authors, publishers, translators, and ratings. You learn not only to query data but also to model how the entities connect.

Who it's for
Read this guide if
  • You are new to SQL and want a structured introduction.
  • You want hands-on practice querying a real dataset in SQLite.
  • You want to understand tables, keys, and relationships alongside SQL queries.
Skip ahead if
  • You already use SQL comfortably and want advanced specialization.
  • You need a short overview rather than a full university-length course.
  • You want instruction focused on a database system other than SQLite, PostgreSQL, or MySQL.
In brief
  • Runtime: 40,128 seconds (11 hours, 8 minutes, 48 seconds).
  • This guide maps the supplied transcript points into 11 chapters.
  • Tools shown include SQLite, the terminal, and Visual Studio Code.
  • The course begins with SQL fundamentals and progresses to relational design.
  • The course starts with SQLite and later introduces PostgreSQL and MySQL.

The walkthrough

Each chapter below is our original written explanation of what happens at that moment in the video — a paraphrase, not a transcript. Click any timestamp to jump the player.

Database foundations and first queries

0:00

What databases are for

The course introduces databases as a way to organize data for creating, reading, updating, and deleting information. It explains how rows represent items and columns describe their attributes, and why databases can suit large, frequently updated collections better than spreadsheets.

10:02

SQL, SQLite, and the course dataset

SQL is introduced as a language for interacting with databases, with SQLite as the starting point before PostgreSQL and MySQL. The examples use Booker Prize longlist data, Goodreads ratings, and vote counts, with VS Code and the terminal used to open and explore the database.

20:15

Selecting and filtering rows

The lesson shows how to retrieve all columns or selected columns, limit result counts, and filter records with `WHERE`. It also introduces comparisons and `NOT`, while noting that SQL systems may implement different subsets of the standard.

30:50

Combining conditions and matching text

Queries combine conditions with `AND` and `OR`, using parentheses to group them, and use `IS NULL` to find missing data. The course also introduces `LIKE` patterns, where `%` stands for a sequence of characters and `_` for one character.

47:21

Ranges, sorting, and result types

The examples use `BETWEEN` for inclusive ranges and filter by fields such as ratings, votes, and page counts. `ORDER BY` sorts results, `DESC` reverses the default order, and additional sort columns can resolve ties.

1:04:00

Aggregate functions and distinct values

Aggregate functions summarize many rows with values such as counts, averages, minima, maxima, and sums; `ROUND` and `AS` format and label results. The lesson distinguishes counting all rows from counting only non-null values and demonstrates removing duplicates with `DISTINCT`.

Relational design and linked queries

1:20:28

Entities and relationship diagrams

The course moves from single-table queries to related entities such as books, authors, publishers, translators, and ratings. It introduces one-to-one, one-to-many, and many-to-many relationships and explains how entity relationship diagrams document them.

1:33:00

Primary keys and foreign keys

A primary key uniquely identifies a row, while a foreign key connects a record to a key in another table. The examples consider ISBNs and custom numeric IDs for linking books and ratings.

1:40:35

Join tables and nested queries

Many-to-many relationships can be represented with a join table containing foreign keys for both related entities, reducing repeated information. Subqueries then retrieve linked IDs dynamically so an outer query can find related records, such as books from a publisher.

2:00:35

Following relationships through subqueries

The examples use nested queries to retrieve ratings for a book and to follow a book-to-author relationship through the relevant tables. These examples show how subqueries connect information that is stored separately.

Moment by moment

TimeWhy it matters
16:36The first SQLite query retrieves every row and column from the book list.
34:28Learn how `AND`, `OR`, and parentheses combine filters.
1:05:00Sort and limit results to find highly rated books.
1:31:20The course introduces primary and foreign keys for linking tables.
1:40:35A join table models the many-to-many relationship between authors and books.

Do this next

  1. Open a SQLite database and practice selecting all rows, choosing columns, and limiting results.
  2. Write filters using `WHERE`, `AND`, `OR`, `LIKE`, `IS NULL`, and `BETWEEN` against a small dataset.
  3. Sketch an ER diagram for books, authors, and publishers, then identify primary and foreign keys.

Common questions

Which database system does the course start with?

It starts with SQLite, then introduces PostgreSQL and MySQL.

What dataset is used in the examples?

The examples use International Booker Prize longlists together with Goodreads ratings and vote counts.

Does the course cover relational database design?

Yes. It discusses entities, relationship types, ER diagrams, primary keys, foreign keys, and join tables.

What is the video’s runtime?

The supplied duration is 40,128 seconds, or 11 hours, 8 minutes, and 48 seconds.

Spot a mistake?

If you spot an error, please report it so we can correct the guide. Every summary is hand-checked against the video.

More course guides