Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

. Consider the following GRADEBOOK relational schema describing the data for a g

ID: 3657604 • Letter: #

Question

. Consider the following GRADEBOOK relational schema describing the data for a grade book ofa particular instructor. (Note: The attributes A, B, C, and D ofCOURSES store grade cutoffs.) CATALOG(Cno, Ctitle) STUDENTS(Sid, Fname, Lname, Minit) COURSES(Term, Sec_no, Cno, A, B, C, D) ENROLLS(Sid, Term, Sec_no) Specify and execute the following queries using the RA interpreter on the GRADEBOOK database schema. a. Retrieve the names ofstudents enrolled in the Automata class during the fall 2009 term. b. Retrieve the Sid values of students who have enrolled in CSc226 and CSc227. c. Retrieve the Sid values of students who have enrolled in CSc226 or CSc227. d. Retrieve the names ofstudents who have not enrolled in any class. e. Retrieve the names of students who have enrolled in all courses in the CATALOG table.

Explanation / Answer

(a) select fname, minit, lname from students natural join enrolls natural join courses natural join catalog where ctitle = ’Database’ and term = ’Fall 2009’ ?f name,minit,lname (sctitle= Database ?term= F all2009 (students ?? enrolls ?? courses ?? catalog)) (b) select fname, minit, lname from students natural join enrolls natural join courses where cno = ’CS226’ or cno = ’CS227’ ?f name,minit,lname (scno= CS226 ?cno= CS227 (students ?? enrolls ?? courses)) (c) select fname, minit, lname from students - select fname, minit, lname from students natural join enrolls ?f name,minit,lname (students) except ?f name,minit,lname (students ?? enrolls)) (d) select ctitle, avg(score) from courses where term = ’Fall 2009’ group by secno having avg(score) > 80 secno Gavg(score)>80 (sterm= F all2009 (courses))