As B only contains the value present in C as it refers C.

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+21 votes

Suppose $R_{1} (\underline{A}, B)$ and $R_{2} (\underline{C}, D) $ are two relation schemas. Let $r_{1}$ and $r_{2}$ be the corresponding relation instances. $B$ is a foreign key that refers to $C$ in $R_{2}$. If data in $r_{1}$ and $r_{2}$ satisfy referential integrity constraints, which of the following is **ALWAYS TRUE**?

- $\prod_{B}(r_{1})- \prod _{C}(r_{2})= \varnothing$
- $\prod_{C}(r_{2})- \prod _{B}(r_{1})= \varnothing$
- $\prod_{B}(r_{1}) = \prod _{C}(r_{2})$
- $\prod_{B}(r_{1}) - \prod _{C}(r_{2}) \neq \varnothing$

+29 votes

Best answer

0

Subset will likely to have less than equal to tupples to the superset, anyway the difference will nullify all. So, produces a empty table/relation.

+11

Referential integrity does not prevent NULL value in foreign key, right ? If so, then maybe, $\Pi_{B}(r_1) - \Pi_{C}(r_2) = \{NULL\}$

0

This is true in Relational Algebra since they remove duplicates automatically .. Incase if we replace both projection operators with SELECT in SQL then this neednot be TRUE as SELECT in SQL doesnot remove duplicates unlike SELECT DISTINCT...

0

@Rounak Agarwal referential integrity constraint says that the value present in foreign key is subset of value present in referred attribute since primary attribute can.t have null values so foreign key can't have null values to preseve the integrity constraint.

- All categories
- General Aptitude 1.5k
- Engineering Mathematics 7.1k
- Digital Logic 2.7k
- Programming & DS 4.9k
- Algorithms 4.2k
- Theory of Computation 5.3k
- Compiler Design 2.1k
- Databases 4k
- CO & Architecture 3.5k
- Computer Networks 4k
- Non GATE 1.4k
- Others 1.5k
- Admissions 559
- Exam Queries 555
- Tier 1 Placement Questions 23
- Job Queries 69
- Projects 18

47,932 questions

52,335 answers

182,384 comments

67,817 users