Consider the following relations:
(profid: integer, name: varchar, salary: integer, age: integer, depid: integer)
Department (did: integer, budget: integer, location: varchar, mgr eid: integer)
Salaries range from $30,000 to $100,000, ages vary from 20 to 80, each
department has about 20 employees on average, there are 10 locations, and
budgets vary from $100,000 to $1 million. You can assume uniform distributions
of values.
For each of the following queries, what index 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.
a. Query1: Print name, age, and salary for all professors. (5 marks)
b. Query2: Find the dids of departments that are located in Edmonton and have a
budget of more than $150,000. (5 marks)