Question: PLEASE ANSWER A B AND C [ 4 0 % ] Consider the following SQL that creates a table R with 2 columns and 2
PLEASE ANSWER A B AND C
Consider the following SQL that creates a table with columns and indexes a primary key on A a secondary Btree index on B
CREATE TABLE R
A INT NOT NULL PRIMARY KEY,
B INT NOT NULL,
C VARCHAR
INDEX B USING BTREE,
INDEX C USING HASH;
Assume the following storage parameters:
i There are records in R stored using fixedlength record arrangement, and sequential file organization wrt the column A there are no overflow blocks.
ii Records are stored on a disk with sector size of bytes and a block spans sectorsEach block contains a header which occupies bytes.
iii The size of a CHAR is byte, an INT is bytes, and the size of a pointer is bytes.
a What is the size of in MB excluding the indices?
b Please estimate the number of disk block accesses are required to answer the following SQL with the use of the Btree secondary index on B You can assume that the SQL returns matching records. Please explain your answer and list your assumptions.
SELECT FROM WHERE AND ;
c Suppose there are two other tables and :
CREATE TABLE S
D INT NOT NULL PRIMARY KEY,
E INT NOT NULL,
INDEX E USING BTREE ;
CREATE TABLE T
F INT NOT NULL PRIMARY KEY,
G VARCHAR
INDEX G UISING BTREE;
Give an optimized relational algebra expression tree for the following query by considering the use of indices, justify your answer with some explanations. You can assume that:
S has records, average value in SE is with standard deviation of
T has records, average value in TG is with standard deviation of
SELECT RA SE TG
FROM R S T
WHERE RA SD AND RA RF AND RB AND RC AND SE ANS TG ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
