TASK #221 · Easy · SantanderAccounts Over Their Overdraft Limit
Your brief
In accounts, balance is the current balance and overdraft_limit
is the allowed overdraft: with a limit of 500 the balance may go down to −500 €,
with a limit of 0 it must not go below zero.
Write a query that returns the accounts whose balance is strictly below −overdraft_limit: account_id, the owner's name full_name, balance, overdraft_limit and the excess excess (how many euros the balance is below the allowed level).
Write a query that returns the accounts whose balance is strictly below −overdraft_limit: account_id, the owner's name full_name, balance, overdraft_limit and the excess excess (how many euros the balance is below the allowed level).
Ctrl / ⌘ + ↵
Result
Write a query and run it to see the results.
Schema
customerscustomer_id, full_name, cityaccountsaccount_id, customer_id, account_type, balance, overdraft_limittransactionstransaction_id, account_id, tx_date, tx_type, amount, description