Question
SQL Databases Consider the following relational schema: course(courseID, deptName) //CourseID is the key enroll(studentID,courseID) // is the key Suppose there are three types of queries
SQL Databases
Consider the following relational schema:
course(courseID, deptName) //CourseID is the key enroll(studentID,courseID) //
(1) Given a courseID, find the name of the department offering that course. (2) Find all students together with all of the departments they are taking courses in; i.e., effectively take the natural join of enroll and course. (3) Given a studentID, find all courses the student is enrolled in.
Questions:
(a) What is the minimal number of indexes needed to speed up all three types of queries?
(b) On which attributes should these indexes be created?
(c) Recommend what type of index to use in each case.
Helpful tip: Before answering, write down the queries for (1), (2), and (3).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started