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?
- A. 24
- B. 6
- C. 10
- 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
- A relation is in 2NF if it is in 1NF and:
- R(A, B, C, D) has functional dependencies A → B and B → C. What is the candidate key of R?
- Which statement about a clustered index is correct?
- Table Emp(id, name, dept, salary, mgr) rows: (1, 'Asha', 'HR', 50000, NULL), (2, 'Ravi', 'IT', 70000, 1), (3, 'Meena', 'IT', 70000, 2)…
- Transaction T2 reads a value that T1 has written but not yet committed; T1 later rolls back. What is this anomaly called?
- Table Emp(id, name, dept, salary, mgr) rows: (1, 'Asha', 'HR', 50000, NULL), (2, 'Ravi', 'IT', 70000, 1), (3, 'Meena', 'IT', 70000, 2)…