CS FundamentalsEasyTCS NQT · Infosys pattern

Two tables have 6 rows and 4 rows. How many rows does `SELECT * FROM A, B;` (no WHERE clause) return?

  1. A. 24
  2. B. 6
  3. C. 10
  4. D. 4

Correct answer: A. 24

A comma join without a condition is a Cartesian product: 6 × 4 = 24 rows. 10 would be a UNION ALL of the two tables.

More DBMS and SQL questions

Exams that ask this topic