
Ultimate access to all questions.
You are working with a lakehouse in Fabric that contains a table named 'Transactions' with columns 'TransactionID', 'ProductID', 'CustomerID', 'TransactionDate', and 'Amount'. You need to write a SQL query to find the total amount of transactions for each customer in the last month. How would you structure this query?
A
SELECT CustomerID, SUM(Amount) AS TotalAmount FROM Transactions WHERE TransactionDate >= DATEADD(month, -1, GETDATE()) GROUP BY CustomerID;
B
SELECT CustomerID, SUM(Amount) AS TotalAmount FROM Transactions GROUP BY CustomerID;
C
SELECT CustomerID, Amount AS TotalAmount FROM Transactions WHERE TransactionDate >= DATEADD(month, -1, GETDATE());
D
SELECT CustomerID, Amount AS TotalAmount FROM Transactions;