in Databases
844 views
2 votes
2 votes
Say I have two tables and they have some attributes in common, assume x is common, now will x will appear once in the output or twice for following cases?

Natural join

Cross product

Conditional join

Please explain.
in Databases
844 views

1 comment

Once in natural join and twice in others
0
0

1 Answer

4 votes
4 votes
Best answer

$R$

A B
1 2
1 3
2 1

$S$

A C
1 3
2 3
2 4

Case I) $R\Join S$

A B C
1 2 3
1 3 3
2 1 3
2 1 4

Case II) $R\times S$

A B A C
1 2 1 3
1 2 2 3
1 2 2 4
1 3 1 3
1 3 2 3
1 3 2 4
2 1 1 3
2 1 2 3
2 1 2 4

Case III) $R\Join _{A>1 } S$

A B A C
2 1 1 3
2 1 2 3
2 1 2 4
selected by