Question: Q 2 [ 5 0 % ] Consider the following SQL query: SELECT * FROM R , S WHERE ( R . c = S

Q2[50%] Consider the following SQL query:
SELECT *
FROM R, S
WHERE (R.c=S.c) AND (71= R.a AND R.a =80) AND (S.b=5)
Given the above SQL query, calculate (a) the cost (number of block accesses) and (b) the
output size (number of tuples) produced by the query plan below for this query.
The following information can be used:
The relation schemas are R(id,a,c) and S(id,b,c). The attributes id,a,b, and c are
integers; id is a key for both R and S.
R has 1000 records and S has 10000 records.
The domain of attribute R.a is [1,200].
The domain of attribute S.b is [1,10].
The domain of attributes R.c and S.c is [1,10].
The values of non-key attributes are uniformly distributed.
All values in the attribute domains appear in the relations.
Each block can hold 10 records.
The smaller temporary table (between T1 and T2) is used as the outer relation of
the block nested loop join.
Show your steps clearly.
Q 2 [ 5 0 % ] Consider the following SQL query:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!