Management & CommerceVery hardMBA Placement · Data Analyst · SQL test
orders.created_at is a TIMESTAMP; a bare date literal is read as midnight. Rows: 2024-03-01 09:00, 2024-03-15 10:00, 2024-03-31 18:45 and 2024-04-01 08:00. How many rows does WHERE created_at BETWEEN '2024-03-01' AND '2024-03-31' return, and what is the safe filter for March?
- A. 3; BETWEEN covers the whole of 31 March
- B. 3; use BETWEEN '2024-03-01' AND '2024-04-01'
- C. 4; BETWEEN includes the next day's midnight
- D. 2; use >= '2024-03-01' AND < '2024-04-01'
Correct answer: D. 2; use >= '2024-03-01' AND < '2024-04-01'
The upper bound is 2024-03-31 00:00, so the 18:45 order on 31 March is missed: 2 rows. A half-open range (>= start AND < next month) catches every timestamp in March; ending BETWEEN at '2024-04-01' would wrongly include an order placed exactly at midnight on 1 April.
Practise more Operations, Supply Chain & Business Analytics questionsOperations, Supply Chain & Business Analytics: notes and key points
More Operations, Supply Chain & Business Analytics questions
- B2:B6 hold scores 80, 95, 80, 70, 95. C2 has =RANK.EQ(B2, B2:B6) + COUNTIF(B2:B2, B2) − 1, filled down to C6. What do C4 and C6 show?
- A2:A9 hold reps Asha, Ravi, Asha, Meena, Ravi, Kiran, Asha, Meena and B2:B9 hold deal values 150, 90, 200, 120, 101, 100, 80, 130. What…
- sales(region, product, amt) contains these region–product combinations: North–A, North–B, South–A, South–B, South–C and East–A (several…
- A customer's path before a ₹5,000 purchase is Social ad → Search ad → Email → Display ad. How much revenue does the Search ad get under…
- Among 10,000 transactions, 100 are fraudulent. Model A catches 80 frauds and flags 400 genuine ones; Model B catches 90 frauds and flags…
- A churn model scores three churners 0.9, 0.7 and 0.4, and four non-churners 0.8, 0.5, 0.3 and 0.2. What is the ROC AUC?