Which statement accomplishes this?

You need to create a table named ORDERS that contain four columns:
1. AN ORDER_ID column of number data type
2. A CUSTOMER_ID column of number data type
3. AN ORDER_STATUS column that contains a character data type
4. A DATE_ORDERED column to contain the date the order was placed.
When a row is inserted into the table, if no value is provided when the order was placed, today’s date should be
used instead.
Which statement accomplishes this?

You need to create a table named ORDERS that contain four columns:
1. AN ORDER_ID column of number data type
2. A CUSTOMER_ID column of number data type
3. AN ORDER_STATUS column that contains a character data type
4. A DATE_ORDERED column to contain the date the order was placed.
When a row is inserted into the table, if no value is provided when the order was placed, today’s date should be
used instead.
Which statement accomplishes this?

A.
CREATE TABLE orders (
order_id NUMBER (10),
customer_id NUMBER (8),
order_status VARCHAR2 (10),
date_ordered DATE = SYSDATE);

B.
CREATE TABLE orders (
order_id NUMBER (10),
customer_id NUMBER (8),
order_status VARCHAR2 (10),
date_ordered DATE DEFAULT SYSDATE);

C.
CREATE OR REPLACE TABLE orders (
order_id NUMBER (10),
customer_id NUMBER (8),
order_status VARCHAR2 (10),
date_ordered DATE DEFAULT SYSDATE);

D.
CREATE OR REPLACE TABLE orders (
order_id NUMBER (10),
customer_id NUMBER (8),
order_status VARCHAR2 (10),date_ordered DATE = SYSDATE);

E.
CREATE TABLE orders (
order_id NUMBER (10),
customer_id NUMBER (8),
order_status NUMBER (10),
date_ordered DATE = SYSDATE);

F.
CREATE TABLE orders (
order_id NUMBER (10),
customer_id NUMBER (8),
order_status NUMBER (10),
date_ordered DATE DEFAULT SYSDATE);

Explanation:
Requirement that Order_Status should be a character data type
Not E: Order_status must be a character data type. There is also a syntax error.



Leave a Reply 0

Your email address will not be published. Required fields are marked *