How many records are returned by following query?

Table: Customer (Id, Name) has 3 records
Table: Order (Id, Order_Date) has 15 records

Select * From Customer, Order

Answer:
Above query returns 15 records. This is also known as Cartesian Product.

For a table with N records and another table with M records. Cartesian Product has N * M number of records.

Read the full book at www.amazon.com
Posted in SQL, SQL Interview Questions

Leave a Reply

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

*