SQL Tutorial 14: Inner, Left, Right, Full, and Cross Joins Explained
Watch the entire SQL playlist here: https://www.youtube.com/playlist?list=PL_neLGJ5LPUzPIg96tf7rXb57D6-3n5Pq
In this tutorial, we dive deep into SQL Joins and how they work! You’ll learn:
✅ What INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, and CROSS JOIN do
✅ How to use each join with real SQL examples
✅ The differences between them and when to use which join
Schema & Sample Data:
CREATE TABLE Employees (
EmployeeID INT PRIMARY KEY,
EmployeeName VARCHAR(50),
DepartmentID INT
);
INSERT INTO Employees (EmployeeID, EmployeeName, DepartmentID) VALUES
(1, 'Alice', 101),
(2, 'Bob', 102),
(3, 'Charlie', NULL),
(4, 'David', 104);
CREATE TABLE Departments (
DepartmentID INT PRIMARY KEY,
DepartmentName VARCHAR(50)
);
INSERT INTO Departments (DepartmentID, DepartmentName) VALUES
(101, 'HR'),
(102, 'IT'),
(103, 'Finance'),
(104, 'Marketing');
Join Type | Matches Data? | Includes Non-Matching Data?
-------------- | ------------ | ----------------------------
INNER JOIN | Yes | No
LEFT JOIN | Yes | Left Table Rows Kept
RIGHT JOIN | Yes | Right Table Rows Kept
FULL JOIN | Yes | Both Tables Kept
CROSS JOIN | No | All Possible Combinations
Follow me on LinkedIn: https://www.linkedin.com/in/paragtech/
Relevant hastags:
#SQL #SQLTutorial #SQLJoins #InnerJoin #LeftJoin #RightJoin #FullJoin #CrossJoin #Database #SQLQueries #SQLServer #LearnSQL #SQLForBeginners #DataAnalysis #Programming #Coding #TechEducation #DatabaseManagement #SQLTraining #SoftwareDevelopment #SQLCourse