Menu

SQL Joins Explained: Fast Revision Notes for IBPS SO IT Officer 2026

Jitendra Chadar
July 10, 2026
10 min read
DBMS & SQL
SQL Joins Explained: Fast Revision Notes for IBPS SO IT Officer 2026

SQL Joins are one of the most important DBMS topics for competitive exams and technical interviews. Questions are usually conceptual and require you to identify which rows will appear in the result after applying a specific JOIN.

Instead of memorizing definitions, learn what each JOIN returns. Once you understand that, solving SQL Join questions becomes much easier.

Most competitive exams ask output-based questions on SQL Joins rather than definitions. Focus on understanding the result of each JOIN.

Quick Revision Cheat Sheet

JoinReturns
INNER JOINOnly matching rows
LEFT JOINAll rows from the left table + matching rows from the right table
RIGHT JOINAll rows from the right table + matching rows from the left table
FULL OUTER JOINAll rows from both tables
CROSS JOINCartesian Product
SELF JOINSame table joined with itself

Why Are SQL Joins Needed?

In a relational database, related information is stored in separate tables to reduce redundancy.

For example:

  • Employee details are stored in one table.
  • Department details are stored in another table.

To display an employee along with the department name, SQL combines data from both tables using a JOIN.

Sample Tables

We'll use these two tables throughout the article, so it's worth keeping them in mind as you read.

Employee

EmpIDNameDeptID
1Rahul10
2Priya20
3Amit30
4SnehaNULL

Department

DeptIDDepartment
10HR
20IT
40Finance

Notice the mismatch on purpose: Amit (DeptID 30) and Sneha (no DeptID) don't have a matching department, and Finance (DeptID 40) has no employee. This mismatch is exactly what makes the different JOIN types behave differently — keep an eye on these four "odd ones out" as we go.

Click to enlarge
SQL Join Sample Tables
The Employee and Department tables used throughout this article.

Understanding How a JOIN Works

Every JOIN follows the same two-step logic — only the final "keep or discard" rule changes.

StepWhat Happens
1. CompareSQL compares the matching column in both tables — here, Employee.DeptID = Department.DeptID
2. DecideBased on the JOIN type, SQL decides which matched and unmatched rows to keep in the result
   Employee Table  ──┐
                      ├──►  Compare on Employee.DeptID = Department.DeptID  ──►  Apply JOIN rule  ──►  Result
   Department Table ─┘

Everything below is really just six different answers to "what do we keep in step 2?"

The Six JOIN Types — Set View

Before the details, here's how each JOIN maps to the three possible regions: rows only in the left table, rows that match in both, and rows only in the right table.

JOINLeft-only rowsMatching rowsRight-only rows
INNER JOIN
LEFT JOIN
RIGHT JOIN
FULL OUTER JOIN
CROSS JOIN— (not row-matched; every row × every row)
SELF JOIN— (same table compared against itself)

Keep this table in mind — every join below is just one row of it, explained in detail.

1. INNER JOIN

An INNER JOIN returns only the rows where the matching condition is satisfied in both tables.

Syntax

SELECT *
FROM Employee
INNER JOIN Department
ON Employee.DeptID = Department.DeptID;

Set Diagram

   Employee            Department
 ┌───────────┐       ┌───────────┐
 │ Amit      │       │           │      Only the overlapping
 │ Sneha     │▓▓▓▓▓▓▓│ Finance   │      region (Rahul→HR,
 │           │▓Rahul▓│           │      Priya→IT) is returned.
 │           │▓Priya▓│           │
 └───────────┘       └───────────┘

Result

EmpIDNameDepartment
1RahulHR
2PriyaIT

Only matching rows appear. Employees without a matching department are excluded, and departments without employees are excluded too.

Remember

INNER = Intersection

Think of INNER JOIN as the common portion shared by both tables.

2. LEFT JOIN

A LEFT JOIN returns:

  • Every row from the left table
  • Matching rows from the right table

If there is no matching row, SQL fills the right-side columns with NULL.

Syntax

SELECT *
FROM Employee
LEFT JOIN Department
ON Employee.DeptID = Department.DeptID;

Set Diagram

   Employee (ALL kept)   Department
 ┌───────────────────┐  ┌───────────┐
 │▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓│  │           │
 │▓ Amit  → NULL     ▓│  │ Finance   │  (not returned —
 │▓ Sneha → NULL     ▓│  │           │   no employee matches it)
 │▓ Rahul → HR       ▓│▓▓│           │
 │▓ Priya → IT       ▓│▓▓│           │
 └───────────────────┘  └───────────┘

Result

EmpIDNameDepartment
1RahulHR
2PriyaIT
3AmitNULL
4SnehaNULL

All employees are included, even when no matching department exists.

Memory Trick

LEFT = Everything on the LEFT + matches from the RIGHT

Exam Trap: LEFT JOIN never removes rows from the left table.

3. RIGHT JOIN

A RIGHT JOIN works exactly like a LEFT JOIN, but the roles of the tables are reversed. It returns:

  • Every row from the right table
  • Matching rows from the left table

Syntax

SELECT *
FROM Employee
RIGHT JOIN Department
ON Employee.DeptID = Department.DeptID;

Set Diagram

   Employee              Department (ALL kept)
 ┌───────────┐         ┌───────────────────────┐
 │ Amit      │         │▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓│
 │ Sneha     │         │▓ NULL   ← Finance     ▓│
 │           │▓▓▓▓▓▓▓▓▓│▓ Rahul  → HR          ▓│
 │           │▓▓▓▓▓▓▓▓▓│▓ Priya  → IT          ▓│
 └───────────┘         └───────────────────────┘

Result

EmpIDNameDepartment
1RahulHR
2PriyaIT
NULLNULLFinance

The Finance department appears even though no employee belongs to it.

Memory Trick

RIGHT = Everything on the RIGHT + matches from the LEFT

LEFT JOIN and RIGHT JOIN are mirror images of each other.

4. FULL OUTER JOIN

A FULL OUTER JOIN returns:

  • All matching rows
  • All non-matching rows from the left table
  • All non-matching rows from the right table

If no match exists, SQL fills the missing columns with NULL.

Syntax

SELECT *
FROM Employee
FULL OUTER JOIN Department
ON Employee.DeptID = Department.DeptID;

Set Diagram

   Employee (ALL)        Department (ALL)
 ┌───────────────────┐  ┌───────────────────┐
 │▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓│  │▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓│
 │▓ Amit  → NULL     ▓│  │▓ NULL  ← Finance  ▓│
 │▓ Sneha → NULL     ▓│  │▓                  ▓│
 │▓ Rahul → HR       ▓│▓▓│▓                  ▓│
 │▓ Priya → IT       ▓│▓▓│▓                  ▓│
 └───────────────────┘  └───────────────────┘
       Nothing is left out on either side

Result

EmpIDNameDepartment
1RahulHR
2PriyaIT
3AmitNULL
4SnehaNULL
NULLNULLFinance

Memory Trick

FULL = Left + Right, everything

FULL OUTER JOIN is useful when you want to see both matching and unmatched records from both tables.

5. CROSS JOIN

A CROSS JOIN returns the Cartesian Product of two tables — every row from the first table is paired with every row from the second table. There's no matching condition involved at all.

Syntax

SELECT *
FROM Employee
CROSS JOIN Department;

Row Count

TableRow Count
Employee4
Department3
CROSS JOIN4 × 3 = 12

Sample Result (first 6 of 12 rows)

EmployeeDepartment
RahulHR
RahulIT
RahulFinance
PriyaHR
PriyaIT
PriyaFinance
......

Memory Trick

CROSS = Multiply rows (no matching, no filtering)

Exam Trap: CROSS JOIN does not require an ON condition.

6. SELF JOIN

A SELF JOIN joins a table with itself. It is mainly used when rows within the same table are related to each other.

Typical examples:

  • Employee → Manager
  • Parent → Child
  • Teacher → Mentor

Example

SELECT
    e.Name AS Employee,
    m.Name AS Manager
FROM Employee e
LEFT JOIN Employee m
ON e.ManagerID = m.EmpID;

How It Works

        Employee (as "e")            Employee (as "m")
        every employee row    ──►    matched against itself
                                       to find their Manager row

A SELF JOIN is not a separate JOIN type — it's simply any of the JOINs above (usually LEFT or INNER), applied to a table paired with itself, using table aliases (e, m) to tell the two copies apart.

SELF JOIN is not a separate JOIN type. It is simply a table joined with itself using aliases.

SQL Joins Comparison Table

JoinMatching RowsLeft OnlyRight Only
INNER
LEFT
RIGHT
FULL
CROSSCartesian Product
SELFSame table

SQL Joins at a Glance

                         SQL JOINS
                             │
          ┌──────────────────┼──────────────────┐
          │                  │                  │
       INNER               OUTER              SPECIAL
    (intersection)            │             ┌────┴────┐
                    ┌─────────┼─────────┐   │         │
                    │         │         │  CROSS     SELF
                  LEFT      RIGHT      FULL  (product) (same table)
               (left + match) (right + match) (everything)
Click to enlarge
Types of SQL Joins Diagram
Classification of SQL Joins.

Common Exam Traps

These conceptual questions are frequently asked in IBPS SO IT Officer, NIELIT, GATE, and technical interviews.

#QuestionAnswer
1Which JOIN returns only matching rows?INNER JOIN
2Which JOIN returns every row from the left table?LEFT JOIN
3Which JOIN returns every row from the right table?RIGHT JOIN
4Which JOIN returns every row from both tables?FULL OUTER JOIN
5Which JOIN produces a Cartesian Product?CROSS JOIN
6Which JOIN is used to compare rows within the same table?SELF JOIN
7Does CROSS JOIN require an ON clause?❌ No
8Can INNER JOIN return NULL values?✅ Yes — if the selected columns themselves contain NULLs. Unmatched rows are still excluded.
9Which JOIN is generally used most frequently in real-world applications?INNER JOIN
10Does MySQL support FULL OUTER JOIN directly?❌ No — it's simulated using LEFT JOIN + RIGHT JOIN + UNION

One-Page Revision Sheet

JOINReturns
INNEROnly matching rows
LEFTAll rows from the left table + matching rows
RIGHTAll rows from the right table + matching rows
FULLAll rows from both tables
CROSSCartesian Product
SELFSame table joined with itself

Quick Memory Tricks

Click to enlarge
SQL Joins Quick Memory Tricks
Quick Memory Tricks
JOINOne-Line Trick
INNERIntersection
LEFTEverything Left + Matching Right
RIGHTEverything Right + Matching Left
FULLEverything, both sides
CROSSMultiply rows
SELFSame table, different aliases

🎯 Revision Checklist

Tick the concepts you're confident about before attempting the mock test.

0/8
Revision Progress0%
Keep revising.

What to Study Next

Complete your SQL revision with these related articles.

TopicStatus
SQL Commands✅ Available
SQL Constraints✅ Available
SQL Keys✅ Available
Normalization🚧 Coming Soon
ACID Properties🚧 Coming Soon
Transactions🚧 Coming Soon
Free Practice

Practice SQL Joins

Attempt exam-level SQL JOIN questions with detailed explanations and performance analysis.

Frequently Asked Questions (FAQs)

A SQL Join combines rows from two or more tables based on a related column.