Skip to main contentSkip to solution

Which concept of the relation is shown by the following query?

SELECT EMPLOYEE.EMPID, EMPLOYEE.NAME, ORDER.ORDERID, ORDER.ORDERDATE

FROM EMPLOYEE, ORDER;

Solution

✅ Correct Option: 4

The query lists two tables in the FROM clause with no WHERE or JOIN condition. Every row of EMPLOYEE is therefore paired with every row of ORDER. This is a Cartesian product, giving m×nm \times n rows for tables with mm and nn rows.


Options 1 and 2: an equi-join or natural join needs a matching condition on a common column, such as EMPLOYEE.EMPID=ORDER.EMPIDEMPLOYEE.EMPID = ORDER.EMPID, and this query has none.

Option 3: an outer join needs the keywords LEFT, RIGHT or FULL OUTER JOIN with an ON condition, and neither appears here.

Memory trick: a comma-separated table list with no condition means Cartesian product.

Keyboard Shortcuts

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