Chapter 6 · Subqueries
22. Accounts Opened on the Same Day as Another
Medium20 XPFinance
The fraud team wants to find accounts that were opened on the same day as at least one other account. Return account id, customer_id, account_type, and opened_at. Sort by opened_at, then 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.