
Ultimate access to all questions.
You are working on a data transformation project using Transact-SQL (T-SQL) in Azure Synapse Analytics. The project involves joining two large tables, 'Orders' and 'Customers', on the 'CustomerID' field and then performing a series of transformations, including filtering, aggregation, and sorting. Which T-SQL query would you use to achieve this, considering the size of the tables and the need for performance optimization?
A
SELECT * FROM Orders INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID;*
B
SELECT * FROM Orders, Customers WHERE Orders.CustomerID = Customers.CustomerID AND OrderDate >= DATEADD(year, -1, GETDATE());*
C
SELECT CustomerID, COUNT(OrderID) AS OrderCount FROM Orders GROUP BY CustomerID;
D
SELECT CustomerID, SUM(OrderAmount) AS TotalAmount FROM Orders INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID GROUP BY CustomerID;