Question: Part II: Evaluating Queries with Just Indexes It is sometimes possible to evaluate a particular query using only indexes, without accessing the actual data records.
Part II: Evaluating Queries with Just Indexes It is sometimes possible to evaluate a particular query using only indexes, without accessing the actual data records. Consider a database with two tables: Pokemon(charName, attack, stamina, cType) Captured(charName, player, difficulty) Assume three unclustered indexes, where the leaf entries have the form [search-key value, RID].
Question 9: SELECT cType, COUNT(charName) FROM Pokemon GROUP BY cType;
Question 10 SELECT pType, difficulty FROM Pokemon, Captured WHERE stamina = 90 AND Pokemon.charName = Captured.charName;
Question 11: SELECT COUNT(DISTINCT stamina) FROM Pokemon WHERE cType = 'Fire';
Question 12: (think carefully about this one!): SELECT charName, AVERAGE(difficulty) FROM Captured GROUP BY charName HAVING COUNT(DISTINCT player) > 1;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
