Question: Q . 2 ) Aggregate Functions ( 5 0 points ) Write a query to find, for each combination of year and building name, the
Q Aggregate Functions points
Write a query to find, for each combination of year and building name, the number of
instructors who have taught a course and the average course duration in seconds. The
query should only include groups where there are at least unique instructors, and the
average course duration is less than seconds equivalent to approximately hour and
minutes
Hint: You may need to use the TIMETOSEC & TIMEDIFF function to properly calculate
the AvgCourseDuration column values.
Your result should display the following columns:
Year The year when the course sections were offered.
BuildingName The name of the building where the course sections were held.
NumberOfInstructors The total number of distinct instructors who taught in that
building for the corresponding year.
AvgCourseDuration The average duration of all the course sections in seconds
taught in that building and year combination.
Include an ORDER BY clause to ensure the results highlight more recent years, with
preference given to buildings that had more instructors teaching courses, and within those
groups, prioritize sections with longer average durations.
Your result set should have rows returned.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
