Company: AT and T
Difficulty: medium
Problem Description A payment system requires a SQL query to calculate the total transaction count, total transaction volume, and the associated total commission for each customer. A commission is a fee determined by the customer's country of origin, which acts as a percentage multiplier applied to their transaction amounts. Schema customers Table Column Name Data Type Constraint id INT PRIMARY KEY email VARCHAR(255) UNIQUE country VARCHAR(255) FOREIGN KEY (References countries.name ) countries Table Column Name Data Type Constraint name VARCHAR(255) PRIMARY KEY commission DECIMAL(3,2) transactions Table Column Name Data Type Constraint id INT PRIMARY KEY customer_id INT FOREIGN KEY (References customers.id ) amount DECIMAL(10,2) Required Output Your query should return a result set with the following columns, exactly in this order: email - The customer's email address. country - The customer's country of origin. transactions - The total count of all transactions made by the customer.