Day 5 of 45 · SQL Masterclass · Free

Day 5: Advanced SQL

Build ShopKart category hierarchy trees and reconcile discrepancies between payment gateways and order records.

About 60 minutes of learning and 90 minutes of practice. It runs in your browser, with no install.

What you will be able to do

  • Structure complex analytical pipelines into readable, maintainable Common Table Expressions (CTEs).
  • Traverse hierarchical and recursive data structures using WITH RECURSIVE.
  • Compare and reconcile datasets using set operators UNION, UNION ALL, INTERSECT, and EXCEPT.

What the day covers

CTEs, recursive CTE concept, subqueries, correlated subqueries, EXISTS, UNION, UNION ALL, INTERSECT, EXCEPT.

Questions you should be able to answer afterwards

  • Why prefer UNION ALL over UNION in high-volume data pipelines?
  • What two parts make up a WITH RECURSIVE query?
  • How does the EXCEPT set operator help reconcile staging and production data?

Practice this day's skills

Each page shows the idea moving, then lists problems from easiest.

Builds on Day 4.

Days 1 to 7 are free. Days 8 to 45 need a pass; the plan page lists what each day covers, and the glossary defines each term.