Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following schema of a shoe store database: Store(sid, location) ShoeType(id, style, size, color) Inventory(type, sid, quantity) Table Store has the data of each

Consider the following schema of a shoe store database:

Store(sid, location)

ShoeType(id, style, size, color)

Inventory(type, sid, quantity)

Table Store has the data of each shoe store in the database which contains a unique id and the location. The ShoeType table has the data of each possible type of shoe in the database. This table keeps a unique value as the id, the style, size and the color of the shoe. The Inventory table listed the number of shoe types in each store.

Inventory.type is a foreign key to ShoeType.id and Inventory.sid is a foreign key to Store.sid. We are given the following information about the database: Store contains 500 records with 10 records per page. ShoeType contains 1000 records with 40 records per page. Inventory contains 50,000 records with 50 records per page.

There are 100 values for Inventory.type.

There are 50 value for Store.location

There are 10 values for ShoeType.size (5,6,,14)

There are 1000 values for Inventory.quantity

Consider the following query:

SELECT S.sid, S.location, T.size

FROM Store S, ShoeType T, Inventory I

WHERE S.sid=I.sid AND I.type = T.id;

Draw all possible unique left-deep join query trees for the query.

From your previous answer, consider only those trees where the smallest relation is the left most relation. Now, for the first join in each such tree (i.e. the join at the bottom of the tree), what join algorithm would work best (i.e. cost the least)? Assume that you have 70 pages of buffer memory. There are no 3 indexes; so indexed nested loop is not an option. Consider the Page Oriented Nested Join (PNJ), Block-NJ, Sort-Merge-J, and Hash-J

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

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

2. (1 point) Given AABC, tan A b b

Answered: 1 week ago