Company: Intuit
Difficulty: medium
Problem Description In an accounting software system, your task is to generate a report detailing the transaction summaries for each account. Specifically, for each account's IBAN, calculate the total number of transactions and the sum of transaction amounts, segmented separately for debit and credit transactions. Schema accounts Column Name Type Constraints Description id INT PRIMARY KEY The unique identifier of the account. iban VARCHAR(255) The IBAN code of the account. transactions Column Name Type Constraints Description account_id INT FOREIGN KEY REFERENCES accounts(id) The identifier of the account associated with the transaction. amount VARCHAR(255) The amount of the transaction. Stored as positive strings for credits (e.g., 9772.9 ) and in accounting notation (enclosed in parentheses) for debits (e.g., (5110.34) ). Required Output The output should contain the following columns in the exact order: iban : The IBAN code of the account. total_debit_transactions : The total number