Question: Write an SQL function named department _ course _ count that calculates the total number of course enrollments for each department. This function should then

Write an SQL function named department_course_count that calculates the total number of
course enrollments for each department. This function should then rank the departments based on
the total course enrollments in descending order, providing insights into which departments are
the most active in course participation.
Requirements:
The function should return a table containing the department name, the total number of
course enrollments, and the rank based on enrollments.
The ranking should be done in descending order, with the department having the highest
course enrollments ranked first.
Handle departments with the same number of enrollments by assigning them the same
rank.
Deliverables
SQL code for function creation. (1.25 point)
SQL code for calling the function (0.25 point)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!