The GATE Grind

GATE 2021 CS – Question 33

Databases · Relational Model: Relational Algebra, Tuple Calculus, SQL · 1 mark · Numerical answer

A relation $r(A, B)$ in a relational database has 1200 tuples. The attribute $A$ has integer values ranging from 6 to 20, and the attribute $B$ has integer values ranging from 1 to 20. Assume that the attributes $A$ and $B$ are independently distributed. The estimated number of tuples in the output of $\sigma_{(A>10) \vee (B=18)}(r)$ is ______.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 819 to 820

Explanation

P(A>10)=10/15=2/3 and P(B=18)=1/20. P(union) = 2/3 + 1/20 - (2/3)(1/20) = 0.6833. Times 1200 gives about 820.