SQL and PostgreSQL

Lesson 03 · 12 min

JOIN: linking tables

An order knows its user_id. JOIN fetches the user's name alongside.

Data isn't duplicated: an order stores user_id, not the name and email. A foreign key (REFERENCES users(id)) guarantees the user exists. JOIN stitches rows from two tables by the ON condition.

Sign in to continue

The rest of this lesson opens after sign up

The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.