Joining tables on keys: INNER, LEFT, self joins and finding what does not match.
Key ideas
JOIN ... ONpairs two tables on a key; rows without a match drop out.LEFT JOINkeeps every row on the left; without a match the right side isNULL.- Aliases (
e,d) let you use the same table twice.
Pattern
SELECT e.name, d.name FROM employees e LEFT JOIN departments d ON d.id = e.dept_id;
Finish these first:SQL: Grouping
Lessons
Each lesson explains one idea from zero and ends with a few tasks. Lessons open in order; the explanation can be read at any time.
Boss
03
Project hours
SQL query
The boss opens when every lesson of the topic is finished. Solve it too and the topic is complete, and the topics after it open.