Question: 2 . Assume the School database shown in the Appendix. Write the following queries in ( 1 ) relational algebra and ( 2 ) SQL

2. Assume the School database shown in the Appendix. Write the following queries in (1) relational algebra and (2) SQL. State your assumptions if the semantics are not clear.
STUDENTS(student_id, first_name, last_name, email, major_code, class_year)
COURSES(course_id, course_name, course_description, credits, department_code)
ENROLLMENTS(student_id, course_id, semester, grade)
MAJORS(major_code, major_name, department_code)
DEPARTMENTS(department_code, department_name)
(a) Count the number of students in each department. (12 points)
b)Find the course names and the number of students who have taken each course, sorted by the number of students in descending order. (12 points
c)Find the courses with the highest average grades. (12points)

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!