Back (Current repo: scraps)

random scraps and notes that are useful to me
To clone this repository:
git clone https://git.viktor1993.net/scraps.git
Log | Download | Files | Refs

inner_vs_left_vs_outer_join.txt (493B)


Q: Explain the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL OUTER JOIN.

A: INNER JOIN -> The default option when the keyword JOIN is plainly used. It means that when the two tables are merged, discard anything that's not found in both tables.

LEFT JOIN -> like INNER JOIN + ALL records from the LEFT table (joined value will appear as NULL for these records)

RIGHT JOIN -> like LEFT JOIN, but flip which table gets ALL records joined

OUTER JOIN -> LEFT JOIN + RIGHT JOIN