Management & CommerceModerateBusiness analyst · SQL test
Order 1 contains SKUs x and y; order 3 contains SKUs x, y and z. Query P combines the SKU lists of the two orders with UNION; query Q uses UNION ALL. How many rows does each return?
- A. P = 5, Q = 3
- B. P = 5, Q = 5
- C. P = 3, Q = 5
- D. P = 2, Q = 5
Correct answer: C. P = 3, Q = 5
UNION removes duplicate rows, leaving x, y, z (3 rows). UNION ALL keeps every row from both inputs: 2 + 3 = 5.
Practise more Operations, Supply Chain & Business Analytics questionsOperations, Supply Chain & Business Analytics: notes and key points
More Operations, Supply Chain & Business Analytics questions
- Which statement about the logical order in which a SELECT query is evaluated is correct?
- Table orders has 3 rows and table items has 6 rows. How many rows does SELECT FROM orders CROSS JOIN items return?
- 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…