Module 2 ยท SQL โ asking the database directly Lesson 6 of 15
JOIN โ combining two tables
Data lives in separate tables: sales in one, customers in another. A join brings them together on a shared key.
Worked example
SELECT c.name, SUM(s.amount) FROM customers c JOIN sales s ON s.customer_id = c.id GROUP BY c.name ORDER BY 2 DESC gives your top customers.
Your practice task
Join two of your tables, once with JOIN and once with LEFT JOIN, and explain in one line the difference in the rows that came back.
Do this before moving on. Reading a solution teaches the shape of it; typing it teaches you.
Key takeaway
Data lives in separate tables: sales in one, customers in another. A join brings them together on a shared key.
Keep your place in this course
A free account saves which lessons you have finished and unlocks the certificate. The lesson itself stays free to read.
Create free account or sign inCourse complete
You finished every lesson.
Your certificate is ready, and the projects you built are the proof to attach to an application.
Almost there
15 lessons left of 15
Finish every lesson to unlock the certificate. Each one ends in a practice task โ do them and the final project brief writes itself.