GATE CSE
First time here? Checkout the FAQ!
x
0 votes
468 views
R(ABC)     S(BDE)

F:A->B      B ->C     B->D     D->E

AND R HAS 100 TUPLES AND S HAS 200
asked in Databases by (143 points)   | 468 views

3 Answers

+3 votes
For R A  is key and B is key for S.B is foreign key of R refering B of S.If referential integrity is taken into consideration max and min no of tuples will be 100  and 0 (null values)if not considered max will be 100 and min will be 0(no value of B in R matches  B of S)
answered by Veteran (30.7k points)  
edited by
making it tough- what about cross product? :)
For cross product max 100*200 rows

But if referential integrity is taken how null are allowed as b is key I think min will be one 

By allowing all duplicates in R of b 

But null can also come. Even with referential integrity, child table can have null value for the referred attribute. Here, B can be null for all 100 tuples in R (this also means C is also null for all 100 tuples).

A similar question but "self-join" makes this highly complex:

http://gateoverflow.in/11698/join

Sir please give me a pen and paper explaintion if null values are allowed then it is no more referring as fkey
In referential integrity child value can be either null or a value from the parent.

For referential integrity to hold in a relational database, any field in a 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. In other words, when a foreign key value is used it must reference a valid, existing primary key in the parent table.

 

 

 

@sreshta, no value of B in R matches B of S. it happens when B in R has all null values right???
+1 vote
In R(ABC) and relation S(BDE) we take care on solution we find that A is candiate key for R and B is foreign key for S then apply natural join we get max 100 records because all 200 values of S surly contain 100 records of R therefore maximum value will be 100 but min u can think no match as zero value.
answered by Active (2.1k points)  
0 votes
minmun 0 and maximum 100 tuple .may be no one tuple can be match then give 0 and if match all tuples then get 100.
answered by Active (2.1k points)  

Related questions

0 votes
2 answers
1
+1 vote
0 answers
2
asked in Databases by Null&Void Active (1.8k points)   | 170 views
+3 votes
1 answer
3
asked in Databases by KISHALAY DAS Boss (6.5k points)   | 468 views
Top Users Feb 2017
  1. Arjun

    5288 Points

  2. Bikram

    4230 Points

  3. Habibkhan

    3952 Points

  4. Aboveallplayer

    3086 Points

  5. Debashish Deka

    2378 Points

  6. sriv_shubham

    2308 Points

  7. Smriti012

    2236 Points

  8. Arnabi

    2008 Points

  9. mcjoshi

    1690 Points

  10. sh!va

    1684 Points

Monthly Topper: Rs. 500 gift card

20,860 questions
26,012 answers
59,674 comments
22,114 users