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

Tiered Electricity Bill

The first 100 kWh in a month cost 5 per kWh and every kWh above 100 costs 8. Return meter, month and bill for each row of Consumption. Order by meter, then month.

Table schema

Consumption(meter_id INT, month CHAR(7), kwh INT)

Sample data

Consumption
meter_id | month | kwh
1 | 2026-02 | 120
1 | 2026-03 | 60
2 | 2026-02 | 60
2 | 2026-03 | 90
3 | 2026-03 | 250

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.