Instagram
youtube
Facebook
Twitter

Display Total Payments Received Per Customer

Display Total Payments Received Per Customer
Customer Table:


Query Explanation:

  • CustomerID: Identifies each customer.

  • SUM(Amount): Calculates total payments made by each customer.

  • GROUP BY CustomerID: Groups results so you get one total per customer.

SQL Query:

SELECT 
    CustomerID,
    SUM(Amount) AS TotalPayments
FROM Payments
GROUP BY CustomerID;

Output: