Write a basic JOIN query across multiple tables, then a GROUP BY query.
Asked in the Technical Round 1 stage. Use the customers, accounts, and transactions tables. Include customers without accounts or posted transactions, and consider only transactions whose status is posted.
Output
- One row per customer with
customer_id, customer_name, account_count, posted_transaction_count, and total_posted_amount.
- Include every customer, with zeroes where no matching records exist.
- Order by
customer_id ascending.