In SQL the statement select * from R, S is equivalent to
- (A)
Select * from R natural join S
- (B)
Select * from R cross join S
- (C)
Select * from R outer join S
- (D)
Select * from R inner join S
In SQL the statement select * from R, S is equivalent to
Select * from R natural join S
Select * from R cross join S
Select * from R outer join S
Select * from R inner join S
ANSWER
The statement is equivalent to select * from R cross join S, which is option (B).
Official answer: BSource: ISRO's revised and final answer key of 16 February 2024
Listing two tables in the FROM clause separated by a comma, with no WHERE condition, forms their Cartesian product: every row of R is paired with every row of S.
If R has rows and S has rows, the result has rows and contains the columns of both tables.
CROSS JOIN is defined as exactly this Cartesian product, so select * from R, S is equivalent to select * from R cross join S.
Option A is wrong: a natural join pairs rows only where all common attribute names have equal values and keeps one copy of each such column, so it returns only the matching pairs.
Option C is wrong: an outer join keeps the matching pairs and also pads unmatched rows with nulls, so it is not a plain product.
Option D is wrong: an inner join keeps only the pairs that satisfy a join condition, so it filters rows, while the comma form filters nothing.
KEY IDEA
A comma-separated list of tables in FROM with no condition is the Cartesian product, which is what CROSS JOIN means.
WATCH OUT FOR
Choosing inner join because the comma form is often paired with a WHERE condition. Without that condition nothing is filtered, so it is a cross join, not an inner join.
From the ISRO CS 2023 paper. Every question of this paper · The full paper (PDF, ISRO) · All 4 ISRO SQL questions, with notes