Speed Account balance calculation

Calculate account balance using SQL query.