Tiered Electricity Bill
Medium
Energy Meter Billing
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.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.