Consider the following relations: Emp(eid: integer, ename: varchar, sal: integer, age: integer, did: integer) Dept(did: integer, budget:

Question:

Consider the following relations:
Emp(eid: integer, ename: varchar, sal: integer, age: integer, did: integer)
Dept(did: integer, budget: integer, floor: integer, mgr eid: integer)
Salaries range from $10,000 to $100,000, ages vary from 20 to 80, each department has about five employees on average, there are 10 floors, and budgets vary from $10,000 to $1 million. You can assume uniform distributions of values.
For each of the following queries, which of the listed index choices would you choose to speed up the query? If your database system does not consider index-only plans (i.e., data records are always retrieved even if enough information is available in the index entry), how would your answer change? Explain briefly.
1. Query: Print ename, age, and sal for all employees.
(a) Clustered hash index on ename, age, sal fields of Emp.
(b) Unclustered hash index on ename, age, sal fields of Emp.
(c) Clustered B+ tree index on ename, age, sal fields of Emp.
(d) Unclustered hash index on eid, did fields of Emp.
(e) No index.
2. Query: Find the dids of departments that are on the 10th floor and have a budget of less than $15,000.
(a) Clustered hash index on the floor field of Dept.
(b) Unclustered hash index on the floor field of Dept.
(c) Clustered B+ tree index on floor, budget fields of Dept.
(d) Clustered B+ tree index on the budget field of Dept.
(e) No index.
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Database management systems

ISBN: 978-0072465631

3rd edition

Authors: Raghu Ramakrishan, Johannes Gehrke, Scott Selikoff

Question Posted: