Write a SQL query to identify all customer accounts where the billed amount in a given month does not match the recorded usage data in our product database at Harvey.
Use February 2025 as the given month. Treat a missing billing or usage record as an amount of zero when comparing totals.
account_id, account_name, billed_amount, recorded_usage_amount, and difference.account_id ascending, where difference is billed amount minus recorded usage amount.| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique Harvey customer account identifier |
| account_name | VARCHAR(120) | Customer account name |
| account_status | VARCHAR(20) | Current account status |
| Column | Type | Description |
|---|---|---|
| billing_idPK | INT | Unique billing record identifier |
| account_id | INT | Logical reference to a customer account |
| billing_month | DATE | First day of the billed month |
| billed_amount | NUMERIC(12,2) | Amount billed for the month |
| Column | Type | Description |
|---|---|---|
| usage_idPK | INT | Unique product usage record identifier |
| account_id | INT | Logical reference to a customer account |
| usage_date | DATE | Date the product usage was recorded |
| usage_amount | NUMERIC(12,2) | Monetary value of recorded usage |