Q1: (20 Points) Consider a University that has a main campus and four branch cam
ID: 3733300 • Letter: Q
Question
Q1: (20 Points) Consider a University that has a main campus and four branch campuses (North, South, East, and West). Assume each student have a home campus where they usually register and take classes. However, students can register for any class at any campus. Faculty members teach at a single campus. Each class is offered at a single campus. Assume the following is the centralized database schema: Student (stuID, lastName, firstName, major, credits, homecampus) Faculty(facId, name, department, rank, homeCampus) Class (classNum, campusOffered, facld, schedule, room) Enroll (stuId,classNum, grade) Assume the distributed university database is designed as follows: 1- Tables Student and Faculty are horizontally fragmented into 5 fragments each according to the 'homeCampus' attribute (Studentyain Studentest etc.) 2- Table Enroll is fragmented into 5 fragments (EnrollMain etc) using derived horizontal 3- fragmentation with respect to student table. Table class is stored at the main site. For each of the following query, write the query in SQL, draw query operator tree, and specify which sites are involved in the query evaluation: a) List all majors for students who are located at West campus. b) List class numbers for all classes with schedule equal to MWF ote WP d) List names of all students who are enrolled in class that is offered at the main campus. e) Find names of all students who a grade of'A' in class number 'ICS611'Explanation / Answer
Solution:
a)
SELECT major FROM Student WHERE homecampus= 'West'
Explanation:
The west campus located students will be displayed in the output.
b)
SELECT classNum FROM Class WHERE schedule = 'MWF'
c)
SELECT Faculty.name FROM Faculty INNER JOIN Class ON Faculty.id= Class.facId WHERE schedule= 'MWF'
d)
SELECT fName FROM Student INNER JOIN Enroll ON Student.stuID= Enroll.stuID WHERE homecampus= 'main'
e)
SELECT fName FROM Student INNER JOIN Enroll ON Student.stuID= Enroll.stuID INNER JOIN Class ON Enroll.classNum= Class.classNum WHERE grade= 'A' AND classNum= 'ICS611'
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.