Chapter 5 · JOINs
29. Cards with Account Information
Medium20 XPFinance
The card services team needs a list of all active cards along with the associated account type and current balance. Return card_number, card_type, account_type, and balance. Only include cards with status 'active'.
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.