993 views
0 votes
0 votes

 

Referencing to this gate ques- https://gateoverflow.in/16095/gate2004_13-let-and-two-relation-schema-where-the-primary-key

Let R1 (A, B, C) and R2 (D, E) be two relation schema, where the primary keys are shown underlined, and let C be a foreign key in R1 referring to R2. Suppose there is no violation of the above referential integrity constraint in the corresponding relation instances r1 and r2. 

how does projection (r1) - projection (r2)  we will get empty relation?

For referential integrity to hold in a relational database, any column in a base table that is declared a foreign key can contain either a null value, or only values from a parent table's primary key or a candidate key. 

So C can  have null or duplicate values in foreign key, subtracting entities of D from C can still have null and other values(those were duplicate). So, how will it get empty set?

 

Please log in or register to answer this question.

Related questions

3 votes
3 votes
2 answers
3
Hira Thakur asked Nov 3, 2016
1,505 views
What is on delete no action,on delete cascade, on delete set null action??explain through some eg??
1 votes
1 votes
1 answer
4
rishu_darkshadow asked Sep 28, 2017
5,272 views
Explain recursive foreign key with suitable example..