Balance drops
Using account_balances and accounts, find every SAVINGS or CURRENT account whose balance went down compared with its previous balance record.
If a date was loaded more than once, use only the latest load for that date.
output columns
customer_idaccount_idbalance_dateprevious_balancebalanceuses ,
ctrl + enter to run on the sample data · ctrl + shift + enter to submit
run your query to see the output here. Submit checks it against the sample data, hidden test cases, random data and a large dataset.