BETWEEN can be used to find a range instead of > and <

Prepare for success in your database systems exam with our comprehensive study tools. Use flashcards and multiple choice questions, with detailed hints and explanations. Ace your exam with confidence!

Multiple Choice

BETWEEN can be used to find a range instead of > and <

Explanation:
Using BETWEEN expresses a range in a single condition rather than writing separate greater-than and less-than comparisons. It checks whether a value lies between two endpoints, inclusive of both, by effectively evaluating value >= low AND value <= high. This makes the query easier to read and less error-prone. For example, price BETWEEN 10 AND 20 is the same as price >= 10 AND price <= 20. The other options don’t express a range: NOT is for negation, IN tests membership in a discrete set, and CAST changes data types rather than performing a range check.

Using BETWEEN expresses a range in a single condition rather than writing separate greater-than and less-than comparisons. It checks whether a value lies between two endpoints, inclusive of both, by effectively evaluating value >= low AND value <= high. This makes the query easier to read and less error-prone. For example, price BETWEEN 10 AND 20 is the same as price >= 10 AND price <= 20. The other options don’t express a range: NOT is for negation, IN tests membership in a discrete set, and CAST changes data types rather than performing a range check.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy