QuestionQ216

VerifiedRestricting and sorting data

Examine the description of the BOOKS table:

Question Image

Examine these requirements:

  1. Display titles of books purchased before January 17, 2007 that cost less than 500 or more than 1000.
  2. Sort the titles by purchase date, beginning with the most recently purchased book.

Which two queries can be used?

Choose two
Explanation

NOT BETWEEN 500 AND 1000 is equivalent to price < 500 OR price > 1000, because BETWEEN includes both boundary values. Both valid queries also restrict purchase_date to dates before 17-JAN-2007 and use ORDER BY purchase_date DESC so the most recent qualifying purchases appear first.

Community Discussion

No comments yet. Be the first to start the discussion!