Multiple choice technology databases

You want to display the titles of books that meet these criteria: 1. Purchased before January 21,2001 2. Price is less than \$500 and greater than \$900 You want to sort the results by thier date of purchase, starting with the most recently bought book. Which statement should you use?

  1. SELECT book_title FROM books WHERE price between 500 and 900 AND puchase_date < '21-JAN-2001' ORDER BY purchase_date;

  2. SELECT book_title FROM books WHERE price IN (500,900) AND puchase_date < '21-JAN-2001' ORDER BY purchase_date ASC;

  3. SELECT book_title FROM books WHERE price <500 or >900 AND puchase_date < '21-JAN-2001' ORDER BY purchase_date DESC;

  4. SELECT book_title FROM books WHERE (price<500 OR price>900) AND puchase_date < '21-JAN-2001' ORDER BY purchase_date DESC;

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

To find books with a price less than \$500 or greater than \$900, the conditions must be grouped with parentheses (price&lt;500 OR price&gt;900) so the AND operator does not take precedence. Sorting from most recent requires ORDER BY purchase_date DESC.