Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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]. on Pokemon on Pokemon on Captured For Questions 5-12, say which queries can be evaluated with just data from these indexes. - If the query can, describe how. - If the query can't, explain why. Each question worth 10 points.

Question 5: SELECT MAX(difficulty) FROM Captured;

Question 6: SELECT AVERAGE(difficulty) FROM Captured GROUP BY player;

Question 7: SELECT charName, MIN(difficulty) FROM Captured GROUP BY charName;

Question 8: SELECT COUNT(*) FROM Pokemon WHERE stamina = 85 AND cType = 'Fire';

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Creating A Database In Filemaker Pro Visual QuickProject Guide

Authors: Steven A. Schwartz

1st Edition

0321321219, 978-0321321213

More Books

Students also viewed these Databases questions