10.1 What are Joins? (Overview)
Level: 10 | Version: v1.1 | Author: Meptrasoft
Overview
A JOIN is used to combine related data from two or more tables.
For example:
Students
+
Courses
↓
JOIN
↓
Combined Result
Joins are useful when related information is stored in separate tables.
There are six common join types:
| Join Type | Main Idea |
|---|---|
| INNER JOIN | Matching rows from both tables |
| LEFT JOIN | All left rows + matching right rows |
| RIGHT JOIN | All right rows + matching left rows |
| FULL JOIN | All rows from both tables |
| SELF JOIN | A table joined with itself |
| CROSS JOIN | Every combination of rows |
JOIN → Combine related data from multiple tables.

Simple Example
Suppose we have:
Employees
| emp_id | emp_name | dept_id |
|---|---|---|
| 1 | Ravi | 10 |
| 2 | Priya | 20 |
Departments
| dept_id | dept_name |
|---|---|
| 10 | IT |
| 20 | HR |
The common column is dept_id.
SELECT e.emp_name, d.dept_name
FROM employees e
JOIN departments d
ON e.dept_id = d.dept_id;
Result:
| emp_name | dept_name |
|---|---|
| Ravi | IT |
| Priya | HR |
The JOIN connects the tables using a related column.
Quick Understanding
INNER → Matching
LEFT → Keep Left
RIGHT → Keep Right
FULL → Keep Both
SELF → Same Table
CROSS → Every Combination
Each join type will be explained in the following topics.
Placement Quick Points
- A
JOINcombines data from multiple tables. - Tables are usually joined using related columns.
INNER JOINreturns matching rows.LEFT,RIGHT, andFULLjoins control which unmatched rows are retained.SELF JOINjoins a table to itself.CROSS JOINcreates every possible row combination.
Interview Questions
- What is a JOIN?
A
JOINcombines related data from two or more tables.- Why are joins needed?
Related data is often stored in separate tables, and joins allow us to retrieve it together.
- What are the common types of joins?
INNER LEFT RIGHT FULL SELF CROSS- What column is commonly used to connect tables?
A related key, such as a primary key and foreign key.
Practice & Hands-On Exercises
Using employees and departments:
- Identify the column that connects the two tables.
- Write a basic
INNER JOIN:
SELECT e.emp_id, e.emp_name, d.dept_name
FROM employees e
JOIN departments d
ON e.dept_id = d.dept_id;
- Explain the difference between
INNER JOINandLEFT JOIN. - List the six common join types.
💡 Tip: Test your queries using the in-browser interactive runner above.
Key Takeaway
TABLE A
+
TABLE B
↓
JOIN
↓
COMBINED DATA
Joins allow SQL to combine related data stored in different tables.
End of What are Joins? (Overview)