OCP-1Z0-051-Question Analysis-1st question

Source: Internet
Author: User

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)

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.