QuestionQ73

VerifiedRestricting and Sorting Data

Refer to the Exhibit and review the data in the promotions table.

Question Image

PROMO_BEGIN_DATE is stored using the default date format, dd-mon-rr.

You must generate a report showing the name, cost, and start date of every promotion in the post category that began before January 1, 2000. Which SQL statement should you use?

Question Image

Explanation

With the default DD-MON-RR date format, Oracle implicitly converts '1-JAN-00' to January 1, 2000. PROMO_CATEGORY LIKE '%post%' matches the post category, and the less-than comparison returns only promotions that began before that date. Oracle documents that character values in the default date format are automatically converted when used in date expressions.

Learn more

Community Discussion

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