Management & CommerceVery hardBusiness analyst · SQL test
Table s(id, amt, status) has (1, 100, paid), (2, 250, due), (3, 500, paid), (4, 1000, refund), (5, 250, paid). What does SELECT 1.0 * SUM(CASE WHEN status = 'paid' THEN amt ELSE 0 END) / SUM(amt) FROM s return?
- A. 0.6
- B. About 0.85
- C. 0
- D. About 0.405
Correct answer: D. About 0.405
Paid amounts: 100 + 500 + 250 = 850; total = 2,100; share ≈ 0.405. 0.6 is the share of paid rows (3 of 5), not of value. Multiplying by 1.0 avoids integer division, which in some databases would give 0.
Practise more Operations, Supply Chain & Business Analytics questionsOperations, Supply Chain & Business Analytics: notes and key points
More Operations, Supply Chain & Business Analytics questions
- A subscription app earns ₹500 a month per user at a 60% gross margin, and 4% of users churn each month. Acquiring a user costs ₹2,500…
- A customer first clicked a social-media ad, later a search ad, and finally an email link before buying for ₹3,000. Under last-touch…
- For a commodity component, buyers will consider a supplier only if its quality meets the industry standard, but they choose among such…
- On the product–process matrix, which pairing is most typical?
- Demand requires a takt time of 45 seconds, but the bottleneck station's work content is 50 seconds and cannot be split. What is the…
- Four jobs wait at one machine (processing days; due day): A (3; 5), B (2; 4), C (4; 12), D (5; 9). What is the maximum lateness under the…