Your question is Top Branch Deposits by Customer. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
You are given a single table of PNC deposit transactions. Write a SQL query to return the top 3 customers by total posted deposit amount. Only include rows where transaction_type = 'Deposit' and status = 'Posted'. The result should show each customer's name and total deposited amount, sorted from highest to lowest total.
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| customer_name | VARCHAR(100) | Customer full name |
| branch_name | VARCHAR(100) | PNC branch where the transaction was recorded |
| transaction_type | VARCHAR(20) | Transaction type such as Deposit or Withdrawal |
| status | VARCHAR(20) | Transaction status such as Posted, Pending, or Reversed |
| amount | DECIMAL(12,2) | Transaction amount |
| transaction_date | DATE | Date the transaction occurred |