QuestionQ220

VerifiedCreating and Managing Tables

See the Exhibit and review the structure of the SALES, CUSTOMERS, PRODUCTS, and ITEMS tables:

Question Image

The PROD_ID column in the SALES table is a foreign key that references the PRODUCTS table. Likewise, the CUST_ID and TIME_ID columns in the SALES table are foreign keys referencing the CUSTOMERS and TIMES tables, respectively.

Evaluate the following CREATE TABLE command:

Exhibit:

Question Image

Which statement is true about the preceding command?

Explanation

In a CREATE TABLE AS SELECT statement, the target column list may specify column names and default values, and the number of target columns must equal the number of selected expressions. A direct selection of source columns carries over applicable explicitly created, validated nondeferrable NOT NULL constraints; foreign-key constraints are not carried over. The target column name ORDER_DATE can therefore correspond to the selected TIME_ID expression, and DEFAULT SYSDATE is valid.

Learn more

Community Discussion

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