A well-designed schema makes data consistent, queryable, and scalable. In this lesson you practice joining two tables.
A JOIN combines rows from two or more tables based on a related column. The most common is an inner join, which returns only rows where the join condition matches in both tables.
SELECT posts.title, users.name
FROM posts
JOIN users ON posts.user_id = users.id;Return each post title alongside the name of the user who wrote it by joining posts and users on user_id.
A well-designed schema makes data consistent, queryable, and scalable. In this lesson you practice joining two tables.
A JOIN combines rows from two or more tables based on a related column. The most common is an inner join, which returns only rows where the join condition matches in both tables.
SELECT posts.title, users.name
FROM posts
JOIN users ON posts.user_id = users.id;Return each post title alongside the name of the user who wrote it by joining posts and users on user_id.