Find the names of all students who are enrolled in two


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)

Enrolled(snum: 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 names of all Juniors (Level = JR) who are enrolled in a class taught by

I. Teach.

2. Find the age of the oldest student who is either a History major or is enrolled in a course taught by I. Teach.

3. Find the names of all classes that either meet in room R128 or have five or more students enrolled.

4. Find the names of all students who are enrolled in two classes that meet at the same time.

5. Find the names of faculty members who teach in every room in which some class is taught.

6. Find the names of faculty members for whom the combined enrollment of the courses that they teach is less than five.

7. Print the Level and the average age of students for that Level, for each Level. 40

8. Print the Level and the average age of students for that Level, for all Levels except JR.

9. Find the names of students who are enrolled in the maximum number of classes.

10. Find the names of students who are not enrolled in any class.

11. For each age value that appears in Students, find the level value that appears most often. For example, if there are more FR level students aged 18 than SR, JR, or SO students aged 18, you should print the pair (18, FR).

Request for Solution File

Ask an Expert for Answer!!
Database Management System: Find the names of all students who are enrolled in two
Reference No:- TGS01243633

Expected delivery within 24 Hours