Junior — Middle
Can you name the main types of relationships between tables in SQL?
sobes.tech AI
Answer from AI
Main types of relationships between tables in SQL:
- INNER JOIN — returns only the records that match the condition in both tables.
- LEFT JOIN (LEFT OUTER JOIN) — returns all records from the left table and matching records from the right; if there are no matches, NULLs are shown on the right side.
- RIGHT JOIN (RIGHT OUTER JOIN) — the opposite, returns all records from the right table and matching records from the left.
- FULL JOIN (FULL OUTER JOIN) — returns all records from both tables; where there are no matches, NULLs are shown in the respective fields.
These relationships allow combining data from multiple tables based on specific keys to obtain comprehensive information.