Multiple choice technology programming languages

Given the EJB QL Expression: p.discount BETWEEN 10 AND 15 Which expression is equivalent?

  1. p.discount > 10 AND p.discount < 15

  2. p.discount >= 10 AND p.discount < 15

  3. p.discount >= 10 AND p.discount <= 15

  4. p.discount > 10 AND p.discount <= 15

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The BETWEEN operator in EJB QL is INCLUSIVE on both endpoints, so 'p.discount BETWEEN 10 AND 15' is equivalent to 'p.discount >= 10 AND p.discount <= 15'. This matches SQL BETWEEN semantics. Option B uses < for the upper bound (exclusive), and options A and D both use > for the lower bound (exclusive), making them incorrect.