Question: (35 points) Q2. Consider the following relations: Student(sid: integer, sname: string, major: string, level: string, age: integer) Class(cname: string, meets at: string, room: string, fid:

(35 points) Q2. Consider the following relations: Student(sid: integer, sname: string, major: string, level: string, age: integer) Class(cname: string, meets at: string, room: string, fid: integer) Enrolled(sid: integer, cname: string) Faculty(fid integer, fname: string, deptid: integer) The meaning of these relations is straightforward; for example, Enrolled has one record per student-class pair such that the student is enrolled in the class. Write the following queries in SQL. No duplicates should be printed in any of the answers 1. Find the number of students who are enrolled in a course taught by I. Teach. 2. Find the names of all classes that have more than six students enrolled. 3. Find the names of all classes that either meet in room R543 or have more than six students enrolled. 4. For all levels except JR, print the level and the number of students in that level. 5. Find the average age of students not enrolled in any class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
