Skip to main contentSkip to solution

Which of the following are to be considered while applying JOIN operations on two or more relations?

A. If two tables are to be joined on equality condition on the common attribute, then one may use JOIN with ON clause or NATURAL JOIN in FROM clause.

B. If three tables are to be joined on equality condition, then two JOIN or NATURAL JOIN are required.

C. N-1 joins are needed to combine N tables on equality condition.

D. With JOIN clause, we may use any relational operators to combine tuples of two tables.

Solution

✅ Correct Option: 3

All four statements are valid points for joining relations in SQL.

A: An equality join on a common attribute can be written with JOIN ... ON or with NATURAL JOIN in the FROM clause.

B: Joining three tables needs two join operations, whether JOIN or NATURAL JOIN.

C: B generalises to N tables, which need N-1 joins on equality conditions.

D: The ON condition of a JOIN is not limited to equality. Any relational operator (<<, >>, <=<=, >=>=, !=!=) can be used, which gives a theta join.


Options 1, 2 and 4: each leaves out one true statement, so none is complete.

Memory trick: the equality-only case is the equi join (NATURAL JOIN is a special case of it), while a general condition with any relational operator is a theta join.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question