What are some common codes in SQL?
For this exercise, write a query using the provided account and transaction tables. Include eligible accounts even when they have no qualifying transactions, classify their activity, and handle missing transaction amounts.
2025-01-31account_id, account_name, transaction_count, total_amount, and activity_codetotal_amount descending, then account_id ascending| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique account identifier |
| account_name | VARCHAR(100) | Account holder name |
| status | VARCHAR(20) | Current account status |
| opened_at | DATE | Date the account was opened |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| account_id | INT | Account associated with the transaction |
| posted_at | DATE | Date the transaction was posted |
| amount | DECIMAL(12,2) | Transaction amount |
| transaction_type | VARCHAR(30) | Transaction classification |