Question: It is sometimes possible to evaluate a particular query using only indexes, without accessing the actual data records. Consider a database with two tables which
It is sometimes possible to evaluate a particular query using only indexes, without accessing the actual data records.
Consider a database with two tables which includes information about dogs and people who feed them: People(SSN, Pname, State, Income) Dogs(SSN, Dname, Breed)
Assume three unclustered indexes, where the leaf entries have the form [search-key value, RID].
For each of the following queries, say whether it can be evaluated with just data from the indexes (i.e. without going to the data records). If the query can be answered, describe how. If the query can't, explain why. (a) SELECT MIN(Income) FROM People;
(b) SELECT State, MAX(Income) FROM People GROUP BY State;
(c) SELECT Pname, COUNT(SSN) FROM People GROUP BY Pname;
(d) SELECT COUNT(*) FROM Dogs WHERE Breed = Poodle
(e) SELECT Pname FROM People, Dogs WHERE People.SSN = Dogs.SSN;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
