Chapter 5 · JOINs
49. Customers Who Opened Accounts on the Same Day
Medium20 XPFinance
Find pairs of different customers who opened an account on the same date. Return customer1_id, customer2_id, and the shared opened_at date. Ensure each pair appears only once (customer1_id < customer2_id). Order by opened_at, then customer1_id.
Tables
- PKidINT
- FKcustomer_id→ customers.idINT
- account_typeTEXT
- balanceREAL
- currencyTEXT
- opened_atTEXT
- statusTEXT
Need help?
Ask Sol
AI tutor — looks at your current query and nudges you, without spoiling the answer.
Solution
Try the hints first — solving it yourself is what makes it stick.