RienSQL
TASK #221 · Easy · Santander

Accounts 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).
Expected columnsaccount_id full_name balance overdraft_limit excessSantander
SQL editor
SQLite
Ctrl / ⌘ + ↵
Result

Write a query and run it to see the results.

Schema
customerscustomer_id, full_name, city
accountsaccount_id, customer_id, account_type, balance, overdraft_limit
transactionstransaction_id, account_id, tx_date, tx_type, amount, description