What are the types of joins in SQL?
1Times asked
Jun 2026Last seen
Jun 2026First seen
💡 Model Answer
In SQL, joins combine rows from two or more tables based on a related column. The most common join types are:
- INNER JOIN – Returns only rows that have matching values in both tables. It’s the default join when you just write JOIN.
- LEFT (OUTER) JOIN – Returns all rows from the left table and the matched rows from the right table. If there’s no match, the right side columns are NULL.
- RIGHT (OUTER) JOIN – Opposite of LEFT JOIN; returns all rows from the right table and matched rows from the left.
- FULL (OUTER) JOIN – Combines LEFT and RIGHT joins; returns all rows when there’s a match in either table, filling missing side with NULL.
- CROSS JOIN – Produces the Cartesian product of two tables, returning every combination of rows.
- SELF JOIN – A table joined to itself, useful for hierarchical or relational data within the same table.
Each join type serves different scenarios: INNER JOIN for filtering common data, OUTER joins for preserving data from one side, CROSS JOIN for generating combinations, and SELF JOIN for intra-table relationships. Understanding when to use each ensures efficient queries and accurate results.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers — invisible to screen sharing.
Get Assisting AI — Starts at ₹500