Question 1: SQL queries (20 marks) Consider the following relations: Student (snum: integer, sname: string, major: strin
Posted: Mon Jun 06, 2022 5:34 pm
Question 1: SQL queries (20 marks) 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. a. Find the names of all Seniors (Level = SNR) who are enrolled in a class taught by Bill Johnson. (5 marks) b. Find the age of the oldest student who is an Engineering major. (5 marks) c. Find the names of all classes that either meet in room D610 or have twenty or more students enrolled. (5 marks) d. Find the name of the class that has the largest number of students. (5 marks)