How many rows will the query return ?

Table1 has 6 rows and Table2 has 6
SELECT * FROM Table1, Table2;
a.6
b.12
c.36
d.720
e.Cannot say
rows.
36

prasenjit_in Profile Answers by prasenjit_in Questions by prasenjit_in

• Sep 2nd, 2008

We cannot say since the query will act like an inner join, so all matching rows of both table will be fetched...so cannot say for sure how many rows do match in both table!

• Apr 16th, 2009

It will retreive all rows from both the tables. i.e 6 rows from table1 and 6 rows from table2 will be retrieved and arranged horizontally. so it will have 6+6=12 columns horizontally.

• Jan 31st, 2010

The ans shud be 6*6 = 36 , a cartesian product.

santhosh

• Jan 6th, 2012

Ans: a. 6

Priya

• May 29th, 2012

This will yield to a correlated subquery return in SQL which will be each combination of record from the first table to second table. Which will be 6*6 = 36.

Ramya

• Jul 30th, 2013

36

sudhir jain

• Aug 6th, 2013

It will give all the columns from table 1 and table2

lalit

• Jul 10th, 2014

It will return 12 rows

PARUSHURAM

• Jul 27th, 2014

it will return 36 rows. result will be cartesian product of two tables.

Rishu

• Aug 7th, 2014

Lets say Table1 have 2 columns, 6 rows and Table2 have 3 columns, 6 rows.

Result table from SELECT * FROM TABLE1, TABLE2; will have 5 columns and 36 rows of data.

gurudas

• Aug 11th, 2014

Devu

• Feb 26th, 2015

36

abhay

• Jul 18th, 2016

The ans is 36, I have tested it.