Loading...
Loading...
Learn SQL joins with simple examples covering INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, SELF JOIN, and interview-style explanation for students and freshers. Use this page as a focused learning resource for database concepts, interview preparation, and practical revision.
SQL joins are one of the most important DBMS and SQL interview topics because real databases almost never keep all data in one table. Instead, data is split into related tables, and joins are used to combine it.
A join is an SQL operation used to combine rows from two or more tables based on a related column.
Imagine two tables:
students(student_id, name, dept_id)departments(dept_id, dept_name)Joins can combine student information with department information.
INNER JOIN returns only matching rows from both tables.
Example idea:
If a student has a matching department id, that student row appears.
LEFT JOIN returns all rows from the left table and matching rows from the right table.
If no match exists, right-side values become null.
RIGHT JOIN returns all rows from the right table and matching rows from the left table.
FULL JOIN returns all matching rows plus unmatched rows from both sides.
SELF JOIN joins a table with itself.
It is useful when records in the same table are related, such as employee-manager relationships.
| Join Type | Result | | --- | --- | | INNER JOIN | Only matched rows | | LEFT JOIN | All left rows + matched right rows | | RIGHT JOIN | All right rows + matched left rows | | FULL JOIN | All rows from both tables |
A join is used to combine data from related tables. INNER JOIN returns only matched records, LEFT JOIN returns all rows from the left table and matched rows from the right table, RIGHT JOIN returns all right-table rows, and FULL JOIN returns all rows from both sides.
SQL joins are important because real databases store related data in different tables, and joins help combine that data meaningfully.
INNER JOIN and LEFT JOIN are the most commonly asked joins in interviews, but candidates should also know RIGHT JOIN, FULL JOIN, and SELF JOIN.
Artificial Intelligence Course 2026-2027 | Beginner to Advanced AI Tutorial
26 min - Intermediate
DBMS Interview Questions 2026 | Top Database Viva and SQL Interview Preparation
16 min - Intermediate
Operating System Interview Questions 2026 | OS Viva Questions for Freshers
16 min - Intermediate
Computer Networks Interview Questions 2026 | CN Viva Questions for Freshers
15 min - Intermediate
Process vs Thread in Operating System | Difference, Examples, and Interview Questions
10 min - Beginner
TCP vs UDP | Difference, Use Cases, and Interview Questions for Freshers
10 min - Beginner