Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Sales Versus Target (Composite Join)

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.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.