Company: Saks
Difficulty: medium
Problem Description As part of HackerFinance's accounting software development process, you are tasked with generating a report containing a list of customers and their total balances. The balance for each customer is calculated as the total sum of their debit transactions minus the total sum of their credit transactions. Schema There is one table: transactions Column Name Type Description dt VARCHAR(19) Transaction timestamp (e.g., 'YYYY-MM-DD HH:MM:SS') customer VARCHAR(64) Customer name debit DECIMAL(5,2) Transaction debit amount credit DECIMAL(5,2) Transaction credit amount Required Output The output must contain exactly two columns in this order: customer and balance . The balance must be rounded to exactly 2 decimal places. The results must be grouped by customer and sorted in ascending order by customer . Constraints or Notes The debit and credit columns may contain NULL values. Treat any NULL value as 0 when calculating the balance. Assume the table already contains the correct