This is a verified interview question from Hackerrank. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "SQL: Accounting Software Debit and Credit Report - HackerRank Forward Deployed Engineer" covers key patterns like Other.
"As part of developing accounting software, create a query that returns a list of the totals of positive and negative transactions for each account. Each transaction record has an amount in accounting number format: if the transaction is negative, the number is unsigned but enclosed in parentheses. The result should have the following columns: iban / debit / credit. * iban - account IBAN * debit - the total sum of all negative transactions * credit - the total sum of all positive transactions The debit and credit amounts should have 2 places after the decimal. Ten should be shown as 10.00. The result should be sorted in ascending order by iban."
Join thousands of developers practicing for Hackerrank.