Management & CommerceModerateBusiness analyst · SQL test
For the same logins table (6 rows: A has 3 logins, B has 2, C has 1; 4 are on 'app'), what does SELECT COUNT(DISTINCT cust), COUNT(*), SUM(CASE WHEN device = 'app' THEN 1 ELSE 0 END) FROM logins return?
- A. 6, 6, 4
- B. 3, 6, 4
- C. 3, 3, 4
- D. 3, 6, 2
Correct answer: B. 3, 6, 4
COUNT(DISTINCT cust) counts unique customers (3); COUNT(*) counts rows (6); the CASE expression turns each 'app' row into 1, so the SUM counts app logins (4). This SUM(CASE…) pattern is how analysts pivot categories into columns.
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 risk pooling in a supply chain is correct?
- In SMED (single-minute exchange of die), what is the key first step to reduce setup time?
- In the first step of Vogel's approximation method for a transportation table with cost rows S1: 7, 5, 11; S2: 10, 13, 12; S3: 15, 8, 17…
- The first unit of a new product takes 100 labour hours, and labour follows an 80% unit learning curve (Tₙ = T₁ × n^b, b = log 0.8/log 2 ≈…
- A firm models receivables month by month. Of money now in the 0–30 day bucket, 60% is paid next month and 40% moves to the 31–60 day…
- A Monte Carlo simulation of a warehouse's daily cost gives an estimate whose standard error is ₹400 after 1,000 runs. Roughly how many…