Your question is SQL: Joins Across Multiple Tables. Start with the requirements and the three tables 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.
Yes Bank's Business Analytics team needs a January 2025 view of customer account activity from its core banking transaction data.
Write a PostgreSQL query using joins to return one row per Yes Bank customer and active account, including customers who have no active account or no qualifying transaction.
COALESCE so accounts without qualifying transactions show zero total credit.100000 in successful credits as Priority, and all others as Standard.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique Yes Bank customer identifier |
| customer_name | VARCHAR(100) | Customer's full name |
| segment | VARCHAR(30) | Customer segment |
| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique account identifier |
| customer_id | INT | Customer who owns the account |
| account_type | VARCHAR(30) | Account product type |
| 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 on which the transaction was recorded |
| status | VARCHAR(20) | Transaction processing status |
| amount | DECIMAL(12,2) | Transaction credit amount |