- What is a JOIN?
A JOIN combines rows from multiple tables. - What is INNER JOIN?
Returns matching rows from both tables. - What is LEFT JOIN?
Returns all rows from left table and matching rows from right. - What is RIGHT JOIN?
Returns all rows from right table and matching rows from left. - What is FULL OUTER JOIN?
Returns all matching and non-matching rows from both tables. - What is CROSS JOIN?
Returns Cartesian product of both tables. - What is SELF JOIN?
A table joined with itself. - Difference between INNER and LEFT JOIN?
INNER returns matches only; LEFT returns all left rows. - What happens if no match in LEFT JOIN?
NULL values are returned for right table columns. - What is Cartesian product?
Every row from first table joins with every row from second. - Can we join more than 2 tables?
Yes, multiple joins are allowed. - Which join is used to find unmatched records?
LEFT JOIN with WHERE right_table.id IS NULL. - Scenario: Find customers with no orders.
Use LEFT JOIN between customers and orders, filter NULL orders. - Scenario: Get employee with manager name.
Use SELF JOIN on employee table. - Can we join tables without primary key?
Yes, using common columns.
Bhagavad Gita Wisdom #shorts