← DBMS & SQL learning pathDBMS & SQL · Module 7 of 10
Joins
Combine rows from two or more tables with INNER, LEFT, RIGHT and FULL joins.
📖 Key ideas
- INNER JOIN returns rows with matches in both tables.
- LEFT JOIN returns all left rows, with NULLs where no match.
- RIGHT JOIN is the mirror; FULL JOIN keeps all rows from both.
- Join condition: ON orders.customer_id = customers.id.
- Aliases shorten queries: FROM orders o JOIN customers c ON ...
💡 Real-life example: Joining is matching attendance sheets with student lists by roll number to see names next to dates.
INNER JOINOnly matching rows
LEFT JOINAll left rows plus matches
ONJoin condition
AliasShort name for a table