
Ultimate access to all questions.
You are tasked with querying a warehouse in Fabric to extract sales data for the current year. The warehouse contains a table named 'Sales' with columns 'SaleID', 'ProductID', 'CustomerID', 'SaleDate', and 'Amount'. Write a SQL query that retrieves the total sales amount for each product in the current year. How would you structure this query?
A
SELECT ProductID, SUM(Amount) AS TotalAmount FROM Sales WHERE SaleDate >= DATEADD(year, DATEDIFF(year, 0, GETDATE()), 0) GROUP BY ProductID;
B
SELECT ProductID, SUM(Amount) AS TotalAmount FROM Sales GROUP BY ProductID;
C
SELECT ProductID, Amount AS TotalAmount FROM Sales WHERE SaleDate >= DATEADD(year, DATEDIFF(year, 0, GETDATE()), 0);
D
SELECT ProductID, Amount AS TotalAmount FROM Sales;