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

Sales with Repeat Repairs

Return sale_id and the number of repairs for each sale with two or more repairs. Order by sale_id.

Table schema

Repairs(repair_id INT PRIMARY KEY, sale_id INT, repair_date DATE, cost INT)

Sample data

Repairs
repair_id | sale_id | repair_date | cost
1 | 1 | 2026-05-01 | 100
2 | 2 | 2026-08-20 | 80
3 | 1 | 2026-09-01 | 60
4 | 3 | 2027-03-01 | 150
5 | 2 | 2026-06-01 | 40

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.