Management & CommerceModerateBusiness analyst · SQL test
Table orders has 3 rows and table items has 6 rows. How many rows does SELECT * FROM orders CROSS JOIN items return?
- A. 9 rows
- B. 6 rows
- C. 18 rows
- D. 3 rows
Correct answer: C. 18 rows
A cross join has no join condition: it pairs every row of one table with every row of the other, 3 × 6 = 18. Adding the counts (9) or taking the larger table's size (6, as if each item matched one order) confuses it with a matching inner join.
Practise more Operations, Supply Chain & Business Analytics questionsOperations, Supply Chain & Business Analytics: notes and key points
More Operations, Supply Chain & Business Analytics questions
- Table emp(id, name, dept, salary, mgr) has rows (1, Asha, Sales, 90, NULL), (2, Ravi, Sales, 60, 1), (3, Meena, Sales, 75, 1), (4, Kiran…
- Table emp(id, name, dept, salary, mgr) has rows (1, Asha, Sales, 90, NULL), (2, Ravi, Sales, 60, 1), (3, Meena, Sales, 75, 1), (4, Kiran…
- Daily demand is a steady 50 units, the order quantity is 200 units, and the supplier's lead time is 10 days. At what on-hand stock level…
- Lead-time demand is normal with a standard deviation of 40 units, and the firm holds 60 units of safety stock. What cycle-service level…
- Product X (lead time 1 week) needs 2 units of Y; Y (lead time 2 weeks) needs 3 units of Z; Z has a lead time of 1 week. 100 units of X are…
- Four jobs wait at one machine (processing hours; weight = importance): A (4; 1), B (2; 3), C (6; 2), D (3; 3). Using the weighted shortest…