1) Consider the following two relations for Millennium College: STUDENT (student
ID: 3760627 • Letter: 1
Question
1) Consider the following two relations for Millennium College:
STUDENT (student_id, student_name, campus_address, gpa)
REGISTRATION (student_id, course_id, grade)
Following is a typical query against these relations:
SELECT student.student_id, student_name, course_id, grade
FROM student, registration
WHERE student.student.id = registration.student_id AND gpa > 3.0
ORDER BY student_name;
1a). What attributes should indexes be defined to speed up this query? Give the reasons for each attribute selected.
1b). Write SQL commands to create indexes for each attribute you specified in part a.
Explanation / Answer
a) On student id, because this is primary key and there will be unique element for this attribute.
b) create index studentid_idx on STUDENT(student_id)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.