Exam Preparation Quiz

Question 31 of 75

Choose correct GROUP BY clause(s) for summarizing order quantities

You have a Fabric workspace that contains a warehouse named DW1. The warehouse contains the following tables and columns that store course purchases:

Table nameColumn name
PurchaseCourseID
PurchaseModifiedDate
PurchaseOrderQty
CourseCourseID
CourseName

You need to summarize order quantities as follows:

You have the following T-SQL query:

SELECT 
    YEAR(p.ModifiedDate) AS OrderDate,
    c.Name AS CourseName,
    SUM(p.OrderQty) AS OrderQty
FROM [Purchase] p
INNER JOIN [Course] c
ON c.CourseID = p.CourseID
GROUP BY ________________
ORDER BY OrderDate

How can you complete the T-SQL statement?

Choose the correct answer from the options below.

Explanations for each answer:

Learn more about GROUP BY clauses in SQL Server:
SQL Server GROUP BY
Next Question