Sales Versus Target (Composite Join)
Easy
Join Types Deep Dive
Join Sales to Targets on region and month and show whether the target was met (1) or not (0). Order by region, month.
Table schema
Sales(region VARCHAR(10), month CHAR(7), amount INT)
Targets(region VARCHAR(10), month CHAR(7), target INT)Sample data
Sales
region | month | amount
North | 2026-01 | 120
North | 2026-02 | 80
South | 2026-01 | 90
Targets
region | month | target
North | 2026-01 | 100
North | 2026-02 | 100
South | 2026-01 | 100
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.