Module 02

Multiple-Table Joins

Combine rows from multiple tables using matching columns to extract unified analytical data insights.

📋 Source Datasets (4 Sample Records)

TABLE 1: employees

emp_idnameproject_id
101Amit SharmaP1
102Rohan VermaP2
103Neha GuptaP1
104Vikram SinghNULL

TABLE 2: projects

project_idproject_name
P1Cloud Migration
P2AI Chatbot
P3Data Pipeline
P4Web Portal

1. INNER JOIN

Definition: Returns rows only when there is a matching value in both tables.

SELECT e.name, p.project_name 
FROM employees e 
INNER JOIN projects p 
ON e.project_id = p.project_id;
nameproject_name
Amit SharmaCloud Migration
Rohan VermaAI Chatbot
Neha GuptaCloud Migration

2. LEFT JOIN

Definition: Returns all rows from left table, and matching rows from right table with NULLs for misses.

SELECT e.name, p.project_name 
FROM employees e 
LEFT JOIN projects p 
ON e.project_id = p.project_id;
nameproject_name
Amit SharmaCloud Migration
Rohan VermaAI Chatbot
Neha GuptaCloud Migration
Vikram SinghNULL

3. RIGHT JOIN

Definition: Returns all rows from right table, and matching values from the left table.

SELECT e.name, p.project_name 
FROM employees e 
RIGHT JOIN projects p 
ON e.project_id = p.project_id;
nameproject_name
Amit SharmaCloud Migration
Neha GuptaCloud Migration
Rohan VermaAI Chatbot
NULLData Pipeline
NULLWeb Portal

4. CROSS JOIN

Definition: Produces a complete Cartesian product grid pairing every single item from both tables.

SELECT e.name, p.project_name 
FROM employees e 
CROSS JOIN projects p;
nameproject_name
Amit SharmaCloud Migration
Amit SharmaAI Chatbot
...and so on...Total 16 Pairs

Unlock Real Corporate Scenario Interactive Sandboxes

Basic structures are covered! To clear FAANG, MAANG & top analytical enterprise interviews, buy the complete pack to get 150+ interactive practice question sheets, video explanation keys, and real production datasets.