SQL Data Analytics • Lesson 13
JOINs Fundamentals
Learn how SQL combines related information from multiple tables using matching keys.
0 of 8 concepts completed
Complete the activity and related MCQ to unlock the next concept.
Why Analysts Need JOINs
Real databases split information across tables. Customers live in one table, orders in another. JOINs bring related rows together so you can answer business questions that span both.
Interactive Data
Customers & Orders
The shared column customer_id links the two tables. Orders point back to the customer who placed them.
Customers
| customer_id | name | city |
|---|---|---|
| 101 | Rahul | Delhi |
| 102 | Priya | Mumbai |
| 103 | Amit | Pune |
| 104 | Neha | Delhi |
Orders
| order_id | customer_id | amount |
|---|---|---|
| 5001 | 101 | ₹2,500 |
| 5002 | 102 | ₹7,000 |
| 5003 | 101 | ₹4,500 |
| 5004 | 103 | ₹3,200 |
Joined result (INNER JOIN)
| name | city | order_id | amount |
|---|---|---|---|
| Rahul | Delhi | 5001 | ₹2,500 |
| Priya | Mumbai | 5002 | ₹7,000 |
| Rahul | Delhi | 5003 | ₹4,500 |
| Amit | Pune | 5004 | ₹3,200 |
Learn by Seeing
Two tables, one key
Customers │ │ customer_id ↓ Orders
customer_id is the shared column that lets SQL connect a customer to their orders.
Two tables, one shared key
A JOIN follows the shared key to pair each order with the customer who placed it.
Interactive Activity
What is the main purpose of a JOIN?
Hint: Think about bringing customer info and order info into one result.
SQL Analyst Mindset
Data lives in tables — insight lives in joins
Almost every real analytical question — "which customers drive revenue?", "who hasn't ordered?", "which region is growing?" — requires joining related tables before you can start aggregating.
Identify
Which tables hold the data?
Find the key
Which column links them?
Choose the JOIN
INNER, LEFT or RIGHT?
Select columns
Only the ones you need.
Frequently Asked Questions
SQL JOINs — FAQs
INNER JOIN drops rows with no match; LEFT JOIN keeps every row from the left table and fills unmatched right columns with NULL.
They are optional but strongly recommended — especially when both tables have a column with the same name, like customer_id.
Yes. If a row on one side matches multiple rows on the other, each matching pair produces its own row.
Without ON, SQL may treat the join as a CROSS JOIN and pair every row with every row — usually not what you want.
Lesson Summary
What you learned
Combine related data from multiple tables.
Return only matching rows.
Defines the match condition between tables.
Short names like c and o that keep JOINs readable.