How many rows will the following query produce?

Consider the numbers of rows for the city and country tables.

mysql> SELECT COUNT FROM City;

How many rows will the following query produce?

SELECT * FROM City, Country

Consider the numbers of rows for the city and country tables.

mysql> SELECT COUNT FROM City;

How many rows will the following query produce?

SELECT * FROM City, Country

A.
0

B.
1

C.
4079

D.
4318 (the sum of 239 and 4079)

E.
974881 (the product of 239 and 4079)

F.
None of the above; the query will produce a syntax error.

Explanation:
Comma Join with no WHERE CLAUSE will result in a Cartesian Produce Join and multiply no of rows in city by no of rows in county.



Leave a Reply 0

Your email address will not be published. Required fields are marked *