Machine-translated by Google. Questions are authored in English.
Top

Discussion

The SQL keyword BETWEEN is used:

  • A.for ranges.
  • B.to limit the columns displayed.
  • C.
    as a wildcard.
  • D.None of the above is correct.

Answer: A

Correct answer: for ranges.

BETWEEN tests whether a value falls within a range, and the range is inclusive at both ends: WHERE age BETWEEN 18 AND 65 is the same as age >= 18 AND age <= 65.

That inclusivity is the point most often got wrong, particularly with dates, where BETWEEN '2026-01-01' AND '2026-01-31' excludes anything timestamped later on the last day. It filters rows, so it does not limit columns, and it takes exact values rather than patterns, so it is not a wildcard construct.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.