Write a SQL query using a window function to find the top three highest-value transactions for each customer account over the last 30 days at Sumitomo mitsui financial group.
Use the provided accounts and transactions tables. Treat the date range as inclusive of today and the date 30 days ago. Exclude transactions with missing amounts.
account_id, account_name, transaction_id, transaction_date, amount, and transaction_rank.account_id and rank. Break equal amounts by lower transaction_id.| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique customer account identifier |
| account_name | VARCHAR(100) | Customer account name |
| account_type | VARCHAR(30) | Type of customer account |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| account_id | INT | Customer account associated with the transaction |
| transaction_date | DATE | Date on which the transaction occurred |
| amount | DECIMAL(14,2) | Transaction value in the account currency |