Exam Preparation Quiz

Question 36 of 75

Complete The Query To Compare Average Graduation Points

You work for MDFT Pro, a well-known training agency. The company has a Fabric warehouse that contains two tables named DimDate and Graduation.

DimDate contains the following fields:

NameDataTypeDescription
DateIDDateUnique identifier for the date
IsHolidayBitUsed to denote that the date is a statutory holiday

Graduation contains the following fields:

NameDataTypeDescription
gradIDIntegerGraduation record identifier
pointsScoredIntegerPoints scored in final exam
dateIDDateDate of graduation

You need to compare the average points scored by students who took their final exams on statutory holidays versus non-statutory holidays.

You have the following T-SQL query:

SELECT 
    d.IsHoliday,
    (sum(g.pointsScored) / count(g.gradID)) AS AvgPoints
FROM Graduation g
INNER JOIN DimDate d on g.dateID = d.DateID
_______________

How should you complete the query?

Choose the correct answer from the options below.

Explanations for each answer:

Learn more about GROUP BY queries:
SQL GROUP BY
Next Question