Write a SQL query to find the total volume or count of transactions by terminal, grouped by day, and ordered by the busiest days.
Use the transaction and terminal data provided. Return one row for each terminal and transaction date, excluding transactions that do not match a known terminal.
terminal_code, terminal_name, transaction_day, transaction_count, and total_volume| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| terminal_code | VARCHAR(20) | Code identifying the transaction terminal |
| transaction_ts | TIMESTAMP | Timestamp when the transaction occurred |
| volume | NUMERIC(12,2) | Transaction volume |
| Column | Type | Description |
|---|---|---|
| terminal_codePK | VARCHAR(20) | Unique terminal code |
| terminal_name | VARCHAR(100) | Terminal display name |
| region | VARCHAR(50) | Operational region containing the terminal |