Open Wallets for New Customers
EasyDescription
Customers 26 to 29 joined last and don't have a wallet yet. Open one for each of them
with a single INSERT … SELECT. The account_no is ACC0000 followed by the customer's id,
so customer 26 gets ACC000026. Leave balance and opened_at out, so they get their
defaults.
Then show customer_id, account_no and balance of the wallets of customers 26 and above.
End your query with ORDER BY customer_id.
Tables
| customers |
|---|
| customer_id (PK) |
| full_name |
| accounts |
|---|
| account_id (PK) |
| customer_id (FK) |
| account_no |
| balance |
| opened_at |