Write a SQL query involving GROUP BY, HAVING and NULL handling.
Asked in the Round 1 stage. This was the second Anakin Round 1 question, described by the author as "SQL Query involving GROUPBY, HAVING, NULL".
Use the accounts and transactions tables.
account_id, account_name, transaction_count, non_null_amount_count, and total_amount.total_amount descending, then account_id ascending.| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique account identifier |
| account_name | VARCHAR(100) | Account display name |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| account_id | INT | Account associated with the transaction |
| amount | DECIMAL(12,2) | Transaction amount, which may be missing |