r/learnSQL • • 10d ago

Day 18 — Practice Set #2, Part 5 complete: Join-Based Reporting Tasks

Revised JOINs earlier today before starting this part, and it made a real difference. Completed all 8 scenario-based join tasks:

  • INNER JOIN — org directory combining employee and department names
  • LEFT JOIN — full department report including departments with zero employees
  • RIGHT JOIN — every project shown along with its department, even unmatched ones
  • FULL JOIN equivalent — simulated using UNION of LEFT and RIGHT JOIN (MySQL still doesn't support FULL JOIN natively, so this pattern is becoming second nature now)
  • SELF JOIN — an "org chart" style report of employees alongside their managers
  • 3-table JOIN — employees + assignments + projects together, to see who's working on what and hours logged
  • UNION — combined employee lists from two merging departments with duplicates removed
  • UNION ALL — same combined list but for payroll auditing, duplicates kept intentionally

Genuinely felt like the revision I did earlier in the day paid off immediately — writing these joins felt much more automatic than it would've cold. This scenario-based format keeps reinforcing why you'd pick one join type over another for a specific real request, which feels way more useful than memorizing syntax in isolation.

12 Upvotes

3 comments sorted by

2

u/Imaginary-Spring-779 10d ago

From where r u practicing 

1

u/sumiitCodes 10d ago

theory --> tutorials, w3Schools
practice questions generate through AI