Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Unit 2: SQL Joins - Inner and Left Outer Joins

Lesson 24 of 28 in the free Database Management Systems notes on Siksha Sarovar, written by Rohit Jangra.

24.1 Why Joins?

Data in a relational database is normalized and split into multiple tables. A JOIN clause is used to combine rows from two or more tables, based on a related column between them.

24.2 INNER JOIN

The INNER JOIN keyword selects records that have matching values in both tables.

  • If a row exists in Table A but doesn't have a matching row in Table B, that row is discarded from the result.

24.3 LEFT (OUTER) JOIN

The LEFT JOIN keyword returns all records from the left table, and the matched records from the right table.

  • The result is NULL from the right side if there is no match.
  • Use Case: "List all students and the courses they are enrolled in, including students who haven't enrolled in any course yet."

Join Visualization Table:

Join TypeRecords from Left TableRecords from Right Table
InnerOnly matchingOnly matching
Left OuterAll recordsOnly matching (else NULL)

24.4 Syntax Example:

SELECT Employees.Name, Departments.DeptName
FROM Employees
INNER JOIN Departments ON Employees.DeptID = Departments.DeptID;