Write a query using window functions to rank customer transactions by date within each account.
Use the provided account and transaction data. Include only transactions associated with a known account, and assign the same rank to transactions sharing a date.
account_id, customer_id, transaction_id, transaction_date, and transaction_rank.| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique account identifier |
| customer_id | INT | Customer associated with the account |
| account_type | VARCHAR(30) | Type of financial account |
| account_status | VARCHAR(20) | Current account status |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| account_id | INT | Account associated with the transaction |
| transaction_date | DATE | Date the transaction was posted |
| amount | DECIMAL(12,2) | Transaction amount |
| transaction_type | VARCHAR(30) | Transaction classification |