Chapter 5 · JOINs
44. Accounts That Have No Cards Issued
Medium20 XPFinance
The card operations team wants to identify accounts that have never been issued a card. Use a LEFT JOIN from accounts to cards and filter for NULL. Return account id, customer_id, account_type, balance, and status. Sort by balance descending. Limit to 30.
Tables
- PKidINT
- FKcustomer_id→ customers.idINT
- account_typeTEXT
- balanceREAL
- currencyTEXT
- opened_atTEXT
- statusTEXT
- PKidINT
- FKaccount_id→ accounts.idINT
- card_numberTEXT
- card_typeTEXT
- expiry_dateTEXT
- statusTEXT
- credit_limitREAL
- issued_atTEXT
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.