Customer(CusID), Bill(BillID, CusID) and BillDetails(BillID, ProductID, Price, Amount), Product(ProductID)
SELECT 'MONEY SPENT' = Price * Amount FROM BillDetails
Select C.CusID, Sum((BD.Price * BD.Amount)) as MoneySpent From Customer C Inner Join Bill B on C.CusID = B.CusID Inner Join BillDetails BD on B.BillID = BD.BillID Group By C.CusID;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)