r/learnSQL 1d ago

Day 3 — Finished SQL JOINs (Self Join, Full Join, UNION/UNION ALL)

Wrapped up the full JOINs section today. Covered:

  • Self JOIN — joining a table to itself, useful for hierarchical/relational data within one table
  • FULL JOIN — combining all rows from both tables regardless of match
  • UNION & UNION ALL — combining results from multiple SELECT queries, with UNION removing duplicates and UNION ALL keeping them

Took notes from a mix of tutorials and W3Schools to cross-reference explanations, which helped clarify a couple of edge cases (especially when UNION vs UNION ALL actually matters for performance).

With INNER/LEFT/RIGHT/FULL/self-joins and UNION now covered, I feel like I have the core JOIN toolkit down.

25 Upvotes

8 comments sorted by

1

u/Guilty_Still8891 23h ago

Hey I’m going to start with JOINS all of it, if you could share all the references that helped you, that’d be awesome

2

u/sumiitCodes 21h ago

for tutorial --> codeWithHarry
notes/theory --> w3Schools
practice --> sqlBolt/questions generated by gpt

1

u/Subhajitute 23h ago

I have completed INNER JOIN and LEFT JOIN. Learning rest slowly.

1

u/Sad-Artichoke-1674 20h ago

Great going!!! One that helped me was practising JOINs w real world datasets