2066. Account Balance ¶ SQL 1 2 3 4 5 6 7 8 9SELECT account_id, day, SUM(IF(type = 'Deposit', amount, -amount)) OVER( PARTITION BY account_id ORDER BY day ) AS balance FROM Transactions ORDER BY 1, 2;