Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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) // is the key Suppose there are three types of queries commonly asked on this schema:

(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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions