Question: QUESTION 4 Answer (a), (b) and (c) Consider the following relational schema for a training college: student(studentID, firstName, lastName, DoB, major, level) class(classID, meetsAt, roomNo,
QUESTION 4 Answer (a), (b) and (c) Consider the following relational schema for a training college: student(studentID, firstName, lastName, DoB, major, level) class(classID, meetsAt, roomNo, teacherID) enrolled(studentID, classID) teacher(teacherID, firstName, lastName, departmentID) department(departmentID, name, campus) The primary keys are underlined. The foreign keys are highlighted in blue colour. A student is uniquely identified by a student ID. Classes are uniquely identified by their ID. Students are enrolled in classes (see enrolled table). Classes are taught by teachers. One teacher can teach many classes and each teacher is affiliated with a certain department. Write SQL queries to answer the following: (a) Write statements to create all the tables from relational schema described above. Select appropriate data types for each attribute. Remember to set the primary and foreign keys. (15 marks) (b) List the IDs and full names of students on level 4 whose major is "Business" and are enrolled in more than two classes. (5 marks) (c) List the names of all the teachers who are working in the "Computing Department" located in "Dublin" campus
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
