Code24Lab
Databases & SQL Intermediate

SQL in Practice: Joins, Subqueries, CTEs & Set Operations

Combine tables with every join type, filter with subqueries and EXISTS, structure queries with CTEs and CASE, and merge results with UNION, INTERSECT and EXCEPT, with every answer checked as you go.

20 lessons 20 labs Certificate

  • One-time payment
  • Instant access right after payment
  • Secure checkout with Stripe

About this course

This intermediate SQL course takes you beyond single-table queries. In 20 hands-on labs you combine tables with INNER, LEFT, RIGHT, FULL OUTER, self and range joins, and you learn to spot the bugs that hide in real reports: filters that cancel a LEFT JOIN, one-to-many fan-out, and the NULL trap of NOT IN. You write scalar, correlated and EXISTS subqueries, build derived tables and step-by-step CTEs, segment data with CASE and conditional aggregation, and merge results with UNION, INTERSECT and EXCEPT. Every lab shows the real SQL next to fictional data; you work out the exact result yourself and every answer is checked instantly. A final project and exam lead to your certificate.

Lessons

  1. INNER JOIN: Matching Rows Across Two TablesLabFree
  2. Joins with WHERE, GROUP BY and ORDER BYLab Locked
  3. LEFT JOIN: Keeping Rows Without a MatchLab Locked
  4. ON vs WHERE: The Filter That Cancels a LEFT JOINLab Locked
  5. RIGHT and FULL OUTER JOIN: Reconciling Two ListsLab Locked
  6. One-to-Many Joins: Fan-Out and Double CountingLab Locked
  7. Joining Three Tables: Following the Key PathLab Locked
  8. Self-Joins: A Table Joined to ItselfLab Locked
  9. CROSS JOIN and Range JoinsLab Locked
  10. Scalar Subqueries: One Value Inside Another QueryLab Locked
  11. IN and NOT IN Subqueries (and the NULL Trap)Lab Locked
  12. Correlated Subqueries: Comparing Each Row With Its Own GroupLab Locked
  13. EXISTS and NOT EXISTS: Semi-Joins and Anti-JoinsLab Locked
  14. Derived Tables: Subqueries in FROMLab Locked
  15. CTEs: Building a Query Step by Step With WITHLab Locked
  16. CASE Expressions and Conditional AggregationLab Locked
  17. UNION vs UNION ALL: Stacking ResultsLab Locked
  18. INTERSECT and EXCEPT: Comparing Two ResultsLab Locked
  19. Dates in Queries: Ranges, Differences and DialectsLab Locked
  20. Final Project: A Customer Segment ReportLab Locked