Question: Courses is in class table Consider the following relational schema: Department (deptid, dname, location) Student(snum, sname, deptid, age) Faculty(fid, fname, deptid) Class(cname deptid. meets_at, room,

Courses is in class table
Consider the following relational schema: Department (deptid, dname, location) Student(snum, sname, deptid, age) Faculty(fid, fname, deptid) Class(cname deptid. meets_at, room, faculty) Enrolled(snum,cname, score, grade) Assume that: All students and faculty members must major/work in one depart- ment; Faculty teach courses only in the department they belong to; The names of the courses are unique for each department; Scores are numbers in [0,100]; Faculty in Table Class is a subset of fid in Table Faculty - - - Write each of the following queries using Query-by-Example (QBE). If you believe any one of the following is not expressible in QBE, informally ex- plain why it cannot be expressed. 1. (15 pts) Print the names of the department(s) that have more courses 2. (10 pts) Print the ids and names of the students along with their 3. (15 pts) Print the names of the faculty members who instruct at least than the CS department deptid-101) scores and grades in each course they have enrolled. two courses 4. (10 pts) Print the names of the students who are enrolled in the most 5. (10 pts) Print the student ids with the maximum average score in the 6. (5 pts) Delete the departments that do not have any faculty or number of courses courses they have enrolled in courses at all Consider the following relational schema: Department (deptid, dname, location) Student(snum, sname, deptid, age) Faculty(fid, fname, deptid) Class(cname deptid. meets_at, room, faculty) Enrolled(snum,cname, score, grade) Assume that: All students and faculty members must major/work in one depart- ment; Faculty teach courses only in the department they belong to; The names of the courses are unique for each department; Scores are numbers in [0,100]; Faculty in Table Class is a subset of fid in Table Faculty - - - Write each of the following queries using Query-by-Example (QBE). If you believe any one of the following is not expressible in QBE, informally ex- plain why it cannot be expressed. 1. (15 pts) Print the names of the department(s) that have more courses 2. (10 pts) Print the ids and names of the students along with their 3. (15 pts) Print the names of the faculty members who instruct at least than the CS department deptid-101) scores and grades in each course they have enrolled. two courses 4. (10 pts) Print the names of the students who are enrolled in the most 5. (10 pts) Print the student ids with the maximum average score in the 6. (5 pts) Delete the departments that do not have any faculty or number of courses courses they have enrolled in courses at all
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
