Interview Question

What is JOIN in SQL?

A join combines related rows using an explicit condition.

💡 Concept ✅ Quick Revision 🗃️ SQL

Answer

A join combines rows from two table expressions according to a join condition. • An inner join keeps matching row combinations. • Outer joins can also preserve unmatched rows from one or both sides. • A correct join condition prevents accidental Cartesian products.

💡 SQL Example

SELECT e.name, d.name AS department FROM employees e JOIN departments d ON d.department_id = e.department_id;

Result

Maya | Engineering

⚡ Quick Revision

A join combines related rows using an explicit condition.