2,429 views

Consider Table

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

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

Output
raju

Right ?

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

• 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$

by

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 🤔

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

In SQL NULL denotes unknown value.

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