Database Design and SQL Consider the following relations: Student (snum: integer
ID: 3793583 • Letter: D
Question
Database Design and SQL
Consider the following relations:
Student (snum: integer, sname: string, major: string, level: string, age: integer)
Class (name: string, meets_at: time, room: string, fid: integer)
Enrollment (snum: integer, cname: string)
Faculty (fid: integer, fname: string, deptid: integer)
Write the following queries in SQL. Also, there should be no duplicates printed in any of the answers.
a) Find the names of all students who are enrolled in two classes that meet at the same time.
b) Find the names of faculty members for whom the combined enrollment of the courses that they teach is less than five.
c) Print the Level and the average age of students for that Level, for each Level.
d) Print the Level and the average age of students for that Level, for all Levels except JR.
e) Find the names of students who are enrolled in the maximum number of classes.
f) Find the names of students who are not enrolled in any class.