edited by
817 views
1 votes
1 votes
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 ranges from 10000 to 100000 ages vary from 20 to 80, each department has about five employees on average, there are 10 floors, and budgets vary from 10000 too 1 million. You can assume uniform distribution of values.
For following query, which of the listed index choices would you choose to speed up the query?

Query:Find the dids of departments that are on the 10th floor and have a budget of less than 15000
(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 od Dept
(D) Clustered B+ tree index on the budge field of Dept

I feel in first paragraph what all important is Dept table.
edited by

1 Answer

0 votes
0 votes
This should be sequential access so cannot use hashed index....index on both will give faster access ...so ans should be C

Related questions

2 votes
2 votes
1 answer
1
skywalker_19 asked Oct 8, 2018
677 views
How to prove that if same size blocks are allocated to B trees and B+ trees then:-No. of index nodes in B tree >= No. Of index nodes in B+ tree
1 votes
1 votes
1 answer
3
Arnabi asked Oct 28, 2017
821 views
Given a data file with 100 records per page and 1000 pages and on indexpage capacity of 512 index entries, how deep should be the B+ tree toindex this file.please explain...