How to choose an index for the SQL Server table?
R (ID, name, salary, zipcode)
ID
is the primary key (clustered index)
Queries:
select *
from R
where salary < 4000 and name = "john"
select *
from R
where id = 100 and zipcode = '76200'
select *
from R
where salary > 10000
I have an exam tomorrow and since it is paper pen exam I cannot check whether the indices I chose are correct or not. So I am stuck in this question.
We need to choose 2 other indices and mention
- which attribute form a search key
- index should be clustered or unclustered
- index should be hashed or B+ tree.
Could you please guide me on how to choose the index manually and justify the question above?
Thank you in advance