Company: Decendro_19_jan
Difficulty: medium
Problem Description Write a SQL query to generate a transaction report showing the account activity for the month of September 2022. Schema accounts Column Name Data Type Constraint Description id INT PRIMARY KEY Account ID iban VARCHAR(255) Account IBAN transactions Column Name Data Type Constraint Description account_id INT FOREIGN KEY (accounts.id) Account ID dt DATETIME Transaction date and time amount DECIMAL(8,2) Transaction amount Required Output Your result should include the following columns in order: iban : The account IBAN. transactions : The total number of transactions for the account during the specified month. total : The total transaction amount for the account during the specified month. Constraints or Notes Only include accounts that had at least one transaction in September 2022. Sort the final results in descending order by the total amount. If there is a tie in the total amount, sort by iban in ascending order. Examples Sample Data accounts id iban 1 SE48 2961 208