Question: (40 points) Q2. Consider the following relations: Student(sid: integer, sname: string, major: string, level: string, age: integer) Class(name: string, meets at: string, room: string, fid:
(40 points) Q2. Consider the following relations: Student(sid: integer, sname: string, major: string, level: string, age: integer) Class(name: 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 age of the youngest student who is enrolled in a course taught by I. Teach. 2. Find the names of all classes that have ten or more students enrolled. 3. Find the names of all classes that either meet in room R128 or have ten or more students enrolled. . For all levels except JR, print the level and the maximum age of students for that level. 5.1 Find the names 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
