GATE CS 2021 · Set-1 · SQL Queries

NAT · 1 mark · Problem DBMS-SQL-0059

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

Numerical answer (NAT).

Solve it on GATE DA practice →More Relational Model & SQL problems

Show the worked solution\[\boxed{P(X\cup Y)=P(X)+P(Y)-P(X)P(Y)\ \text{(independent)}}\]\(A\) takes the 15 values \(6,\dots,20\); \(A>10\) holds for \(11,\dots,20\): \(P(A>10)=\dfrac{10}{15}=\dfrac{2}{3}\).\(B\) takes the 20 values \(1,\dots,20\): \(P(B=18)=\dfrac{1}{20}\).\[P=\frac{2}{3}+\frac{1}{20}-\frac{2}{3}\cdot\frac{1}{20}=\frac{40+3-2}{60}=\frac{41}{60}.\]\[1200\times\frac{41}{60}=820.\]Answer: 820

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com