Management & CommerceHardBusiness analyst · SQL test

Table s(id, amt) has amounts 100, 250, 500, 300 and 250. How many rows satisfy WHERE amt BETWEEN 250 AND 500?

  1. A. 1
  2. B. 3
  3. C. 2
  4. D. 4

Correct answer: D. 4

BETWEEN is inclusive at both ends, so 250, 500, 300 and the second 250 qualify: 4 rows. Treating the bounds as exclusive gives 1 (only 300), and forgetting the duplicate 250 gives 3.

More Operations, Supply Chain & Business Analytics questions

Exams that ask this topic