1.View the Exhibit and examine the structure of the SALES, MERS MERs, PRODUCTS, and TIMES tables.
The PROD_ID column is the foreign key in the SALES table, which references the PRODUCTS table.
Similarly, the CUST_ID and TIME_ID columns are also foreign keys in the SALES table referencing the MERs and TIMES tables,
Respectively.
Evaluate the following create table command:
CREATE TABLE new_sales(prod_id, cust_id, order_date DEFAULT SYSDATE)ASSELECT prod_id, cust_id, time_idFROM sales;
Which statement is true regarding the above command?
View and check the structure of the sales, customer, product, and date table. PROD_ID is the foreign key of the sales table reference product table. Similarly, CUST_ID and TIME_ID are also the Foreign keys of the sales table. The statement for creating the following table is evaluated by referring to the customer table and date table respectively, CREATE ......, Which statement is correct?
A.The NEW_SALES table wocould not get created because the DEFAULT value cannot be specified in the column definition.
B.The NEW_SALES table wocould get created and all the not null constraints defined on the specifiedcolumns wocould be passed to the new table.
C.The NEW_SALES table wocould not get created because the column names in the create table command and the SELECT clause do not match.
D.The NEW_SALES table wocould get created and all the foreign key constraints defined on the specified columns woshould be passed to the new table.
Answer: B
Answer:
A: The table cannot be created because the Default value cannot be specified in the defined field (incorrect. You can specify the Default value of the related field through Default when creating the table again)
B: You can create a table. The NOT NULL constraint can also be passed to the new table (correct. You can view the structure of the new table through desc NEW_SALES)
C: You cannot create a table because the field names of the table to be created are different from those of the selected table (incorrect, as long as the data type of the corresponding field is the same, the field names can be different)
D: You can create a table, and all the foreign key constraints will be passed to the new table (incorrect, you can find that only the non-null constraint is passed to the new table through desc NEW_SALES)