Your question is Top 10% Customers by Usage. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Pacific Gas and Electric needs a regional view of its highest-consuming customers. Write a PostgreSQL query that identifies the top 10% of customers in the North Bay and Sierra regions using their total electricity consumption during the first quarter of 2025.
customers with meter_readings and sum each customer's consumption_kwh from January 1 through March 31, 2025.customer_id.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique PG&E customer identifier |
| customer_name | VARCHAR(100) | Customer name |
| region | VARCHAR(50) | PG&E service region |
| Column | Type | Description |
|---|---|---|
| reading_idPK | INT | Unique meter reading identifier |
| customer_id | INT | References customers.customer_id |
| reading_date | DATE | Date of measured consumption |
| consumption_kwh | DECIMAL(10,2) | Electricity consumed in kilowatt-hours |