in Databases retagged by
2,429 views
6 votes
6 votes

Consider Table  

R1                                                              R2
actname    branch                                branch
das               tsr                                         tsr
das               tvm                                        pkd
raju               tsr
raju               pkd
radha            tsr
radha            pkd   

 R1 / R2  means   " customers who have account in all branches of bank described in R2 "

Output
raju
radha

Right ?  

What if R2 contains 0 tuples ? Will it work ? If so How ?

in Databases retagged by
by
2.4k views

1 Answer

9 votes
9 votes
Best answer
  • Assuming no foreign key constraint on attribute branch from $R1$ to $R2$

Then  Query: customers who have an account in all branches of bank described in $R2$.

O/P should be:

raju 
radha


When R2 is empty.

O/P should be all actname present in $R1$


selected by
by

4 Comments

Can you please define the logic behind this, when denominator is NULL, result is Neumerator table.

suppose, here customer who have account in all branches, Now If branch is itself NULL, means there is no branch ??

If so, then why it's returning whole table ??

It means all customer have accounts in all branch, but branch is missing 🤔
0
0

If branch is itself NULL, means there is no branch ??

In SQL NULL denotes unknown value.

refer this https://gateoverflow.in/blog/6685/confused-with-nulls

0
0

when denominator is NULL, result is Neumerator table

No. In that case result will be null.

Dealing with NULLs--

http://www-cs-students.stanford.edu/~wlam/compsci/sqlnulls

0
0

Related questions