QuestionQ180

VerifiedCreating and Managing Tables

You need to create a table named ORDERS containing four columns:

  1. An ORDER_ID column with the NUMBER data type
  2. A CUSTOMER_ID column with the NUMBER data type
  3. An ORDER_STATUS column containing a character data type
  4. A DATE_ORDERED column to store the date on which the order was placed

When a row is inserted into the table and no value is supplied for when the order was placed, today's date should be used instead.

Which statement accomplishes this?

Explanation

In Oracle Database, CREATE TABLE defines a new table, VARCHAR2 is a character data type, and DEFAULT SYSDATE assigns the current server date and time to a DATE column when an INSERT omits that column. SYSDATE returns a value of data type DATE.

Learn more

Community Discussion

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