Which statement is true regarding the PROD_ID_PK constraint?

Evaluate the CREATE TABLE statement:
CREATE TABLE products
(product_id NUMBER(6) CONSTRAINT prod_id_pk PRIMARY KEY, product_name VARCHAR2(15));
Which statement is true regarding the PROD_ID_PK constraint?

Evaluate the CREATE TABLE statement:

CREATE TABLE products
(product_id NUMBER(6) CONSTRAINT prod_id_pk PRIMARY KEY, product_name VARCHAR2(15));

Which statement is true regarding the PROD_ID_PK constraint?

A.
It would be created only if a unique index is manually created first.

B.
It would be created and would use an automatically created unique index.

C.
It would be created and would use an automatically created no unique index.

D.
It would be created and remains in a disabled state because no index is specified in the command.



Leave a Reply 2

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


user

user

CREATE TABLE products
(product_id NUMBER(6) CONSTRAINT prod_id_pk PRIMARY KEY, product_name VARCHAR2(15));

It works so A is correct.

user2

user2

@user : A is NOT correct !
You have proved with your command above that only B is correct .
This is because the table is correctly created without having to create any manual unique index !
The unique index was created automatically as state in:
B.It would be created and would use an automatically created unique index.