Skip to content
GATEiit

GATE CSE 2021 Set 1 Q33: Estimated size of a selection with an OR of two predicates

Question

A relation r(A,B)r(A, B) in a relational database has 1200 tuples. The attribute AA has integer values ranging from 6 to 20, and the attribute BB has integer values ranging from 1 to 20. Assume that the attributes AA and BB are independently distributed.

The estimated number of tuples in the output of σ(A>10)∨(B=18)(r)\sigma_{(A > 10) \vee (B = 18)}(r) is ________.

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 819 to 820 (or 205) (official GATE 2021 final answer key)

Concept used: Selectivity estimation with uniform, independent attributes: P(X∨Y)=P(X)+P(Y)−P(X)P(Y)P(X \vee Y) = P(X) + P(Y) - P(X)P(Y).

First step: AA has 15 equally likely values, 10 of them above 10, so P(A>10)=2/3P(A > 10) = 2/3; and P(B=18)=1/20P(B = 18) = 1/20.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2021 Set 1 CS question paper and final answer key, organised by IIT Bombay. Question paper · Answer key