Which two statements are true about the primary key constraint in a table? ()A、It is not possible to disable the primary key constraint.B、It is possible to have more than one primary key constraint in a single table.C、The primary key constraint can be ref

题目

Which two statements are true about the primary key constraint in a table? ()

  • A、It is not possible to disable the primary key constraint.
  • B、It is possible to have more than one primary key constraint in a single table.
  • C、The primary key constraint can be referred by only one foreign key constraint.
  • D、The primary key constraint can be imposed by combining more than one column.
  • E、The non-deferrable primary key constraint creates an unique index on the primary key column if it is not already indexed.

相似考题
更多“Which two statements are true about the primary key constraint in a table? ()A、It is not possible to disable the primary key constraint.B、It is possible to have more than one primary key constraint in a single table.C、The primary key constraint can be ref”相关问题
  • 第1题:

    Given the following requirements:Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values ‘C‘, ‘H‘ and ‘N‘, and permits inserts only when a corresponding value for the employee‘s department exists in the DEPARTMENT table.Which of the following CREATE statements will successfully create this table?()

    A.CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN (‘C‘,‘H‘,‘N‘)), );

    B.CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES (‘C‘,‘H‘,‘N‘) );

    C.CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN (‘C‘,‘H‘,‘N‘)), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );

    D.CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN (‘C‘,‘H‘,‘N‘)) );


    参考答案:D

  • 第2题:

    Which of the following scenarios will ensure that the value of the NEXT_STEPNO column in a given row of table TABLEX exists as a value of column STEPNO (usually in another row) in the same table?()

    • A、Define a UNIQUE constraint on the columns NEXT_STEPNO and STEPNO.
    • B、Define a CHECK constraint on the NEXT_STEPNO column (NEXT_STEPNO = STEPNO).
    • C、Define column STEPNO as the primary key of TABLEX and column NEXT_STEPNO as a foreign key referencing column STEPNO of the same table.
    • D、Define column NEXT_STEPNO as the primary key of TABLEX and column STEPNO as a foreign key referencing column NEXT_STEPNO in the same table.

    正确答案:C

  • 第3题:

    Given the following requirements: Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values 'C', 'H' and 'N', and permits inserts only when a corresponding value for the employee's department exists in the DEPARTMENT table. Which of the following CREATE statements will successfully create this table?()

    • A、CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN ('C','H','N')), );
    • B、CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES ('C','H','N') );
    • C、CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN ('C','H','N')), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );
    • D、CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN ('C','H','N')) );

    正确答案:D

  • 第4题:

    Which two statements are true about constraints? ()

    • A、The UNIQUE constraint does not permit a null value for the column.
    • B、A UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints.
    • C、The PRIMARY KEY and FOREIGN KEY constraints create a UNIQUE index.
    • D、The NOT NULL constraint ensures that null values are not permitted for the column.

    正确答案:B,D

  • 第5题:

    Examine the command that is used to create a table:  SQL> CREATE TABLE orders(oid NUMBER(6) PRIMARY KEY, odate DATE, ccode NUMBER(6), oamt NUMBER(10,2)) TABLESPACE users;  Which two statements are true about the effect of the above command) ()

    • A、A CHECK constraint is created on the OID column.
    • B、A NOT NULL constraint is created on the OID column.
    • C、The ORDERS table is the only object created in the USERS tablespace.
    • D、The ORDERS table and a unique index are created in the USERS tablespace.
    • E、The ORDERS table is created in the USERS tablespace and a unique index is created on the OIDcolumn in the SYSTEM tablespace.

    正确答案:B,D

  • 第6题:

    Which constraint can be defines only at the column level?()

    • A、UNIQUE
    • B、NOT NULL
    • C、CHECK
    • D、PRIMARY KEY
    • E、FOREIGN KEY

    正确答案:B

  • 第7题:

    Which statements are correct regarding indexes? ()

    • A、 When a table is dropped, the corresponding indexes are automatically dropped.
    • B、 For each DML operation performed, the corresponding indexes are automatically updated.
    • C、 Indexes should be created on columns that are frequently referenced as part of an expression.
    • D、 A non-deferrable PRIMARY KEY or UNIQUE KEY constraint in a table automatically creates a uniqueindex.

    正确答案:A,B,D

  • 第8题:

    Examine the following statement that is used to modify the primary key constraint on the SALES table: SQL> ALTER TABLE SALES MODIFY CONSTRAINT pk DISABLE VALIDATE; Which three statements aretrue regarding the above command()

    • A、The constraint remains valid.
    • B、The index on the constraint is dropped.
    • C、It allows the loading of data into the table using SQL *Loader.
    • D、New data conforms to the constraint, but existing data is not checked.
    • E、It allows the data manipulation on the table using INSERT/UPDATE/DELETE SQL statements.

    正确答案:A,B,C

  • 第9题:

    多选题
    Examine the following statement that is used to modify the primary key constraint on the SALES table: SQL> ALTER TABLE SALES MODIFY CONSTRAINT pk DISABLE VALIDATE; Which three statements aretrue regarding the above command()
    A

    The constraint remains valid.

    B

    The index on the constraint is dropped.

    C

    It allows the loading of data into the table using SQL *Loader.

    D

    New data conforms to the constraint, but existing data is not checked.

    E

    It allows the data manipulation on the table using INSERT/UPDATE/DELETE SQL statements.


    正确答案: C,B
    解析: 暂无解析

  • 第10题:

    单选题
    View the Exhibit and examine the structure of the EMP table. You executed the following command to add a primary key to the EMP table:   ALTER TABLE emp   ADD CONSTRAINT emp_id_pk  PRIMARY KEY (emp_id)   USING INDEX emp_id_idx;   Which statement is true regarding the effect of the command?()
    A

     The PRIMARY KEY is created along with a new index.

    B

     The PRIMARY KEY is created and it would use an existing unique index.

    C

     The PRIMARY KEY would be created in a disabled state because it is using an existing index.

    D

     The statement produces an error because the USING clause is permitted only in the CREATE TABLE command.


    正确答案: D
    解析: 暂无解析

  • 第11题:

    多选题
    Which two statements are true about the primary key constraint in a table? ()
    A

    It is not possible to disable the primary key constraint.

    B

    It is possible to have more than one primary key constraint in a single table.

    C

    The primary key constraint can be referred by only one foreign key constraint.

    D

    The primary key constraint can be imposed by combining more than one column.

    E

    The non-deferrable primary key constraint creates an unique index on the primary key column if it is not already indexed.


    正确答案: D,B
    解析: 暂无解析

  • 第12题:

    单选题
    When defining a referential constraint between the parent table T2 and the dependent table T1, which of the following is true?()
    A

    The list of column names in the FOREIGN KEY clause can be a subset of the list of column names in the primary key of T2 or a UNIQUE constraint that exists on T2.

    B

    The list of column names in the FOREIGN KEY clause can be a subset of the list of column names in the primary key of T1 or a UNIQUE constraint that exists on T1.

    C

    The list of column names in the FOREIGN KEY clause must be identical to the list of column names in the primary key of T2 or a UNIQUE constraint that exists on T2.

    D

    The list of column names in the FOREIGN KEY clause must be identical to the list of column names in the primary key of T1 or a UNIQUE constraint that exists on T1.


    正确答案: A
    解析: 暂无解析

  • 第13题:

    为表TEST中ID列添加主键约束的语法是()

    • A、ALTER  TABLE  TEST  CHANGE( ID  INT  PRIMARY  KEY)
    • B、ALTER  TABLE  TEST  ADD( ID  INT  PRIMARY  KEY)
    • C、ALTER  TABLE  TEST  MODIFY( ID  INT  PRIMARY  KEY)
    • D、ALTER  TABLE  TEST  ADD  CONSTRAINT PK  PRIMARY KEY (ID)

    正确答案:D

  • 第14题:

    数据库中的中的PROFITS表中PRODUCT_NAME与SALE_PERIOD列建立主键。下列哪个语句无法定义这个主键?()

    • A、create table profits(product_name varchar2(10),sale_perion varchar2(10),profit number, constraint pk_profits_01 primary key(product_name,sale_period))
    • B、alter table profits add constraint pk_profits_01 primary key(product_name,sale_period)deferrabl
    • C、以上两者都是

    正确答案:B

  • 第15题:

    When defining a referential constraint between the parent table T2 and the dependent table T1, which of the following is true?()

    • A、The list of column names in the FOREIGN KEY clause can be a subset of the list of column names in the primary key of T2 or a UNIQUE constraint that exists on T2.
    • B、The list of column names in the FOREIGN KEY clause can be a subset of the list of column names in the primary key of T1 or a UNIQUE constraint that exists on T1.
    • C、The list of column names in the FOREIGN KEY clause must be identical to the list of column names in the primary key of T2 or a UNIQUE constraint that exists on T2.
    • D、The list of column names in the FOREIGN KEY clause must be identical to the list of column names in the primary key of T1 or a UNIQUE constraint that exists on T1.

    正确答案:C

  • 第16题:

    You execute this command to drop the ITEM table, which has the primary key referred in the ORDERtable:  SQL> DROP TABLE scott.item CASCADE CONSTRAINTS PURGE;  Which two statements are true about the effect of the command()

    • A、No flashback is possible to bring back the ITEM table.
    • B、The ORDER table is dropped along with the ITEM table.
    • C、The dependent referential integrity constraints in the ORDER table are disabled.
    • D、The dependent referential integrity constraints in the ORDER table are removed.
    • E、The table definition of the ITEM table and associated indexes are placed in the recycle bin.

    正确答案:A,D

  • 第17题:

    You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty.Which statement accomplishes this task?()

    • A、ALTER TABLE students ADD PRIMARY KEY student_id;
    • B、ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student _ id);
    • C、ALTER TABLE students ADD CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);
    • D、ALTER TABLE students MODIFY CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);

    正确答案:C

  • 第18题:

    You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?()

    • A、ALTER TABLE students ADD PRIMARY KEY _ id;
    • B、ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);
    • C、ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;
    • D、ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);
    • E、ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

    正确答案:D

  • 第19题:

    You execute this command to drop the ITEM table, which has the primary key referred in the ORDERS table:SQL> DROP TABLE scott.item CASCADE CONSTRAINTS PURGE;  Which two statements are true about theeffect of the command()

    • A、No flashback is possible to bring back the ITEM table.
    • B、The ORDERS table is dropped along with the ITEM table.
    • C、The dependent referential integrity constraints in the ORDERS table are disabled.
    • D、The dependent referential integrity constraints in the ORDERS table are removed.
    • E、The table definition of the ITEM table and associated indexes are placed in the recycle bin

    正确答案:A,D

  • 第20题:

    多选题
    Examine the command that is used to create a table: SQL> CREATE TABLE orders(oid NUMBER(6) PRIMARY KEY, odate DATE, ccode NUMBER (6), oamtNUMBER(10,2)) TABLESPACE users; Which two statements are true about the effect of the above command()
    A

    A CHECK constraint is created on the OID column.

    B

    A NOT NULL constraint is created on the OID column.

    C

    The ORDERS table is the only object created in the USERS tablespace.

    D

    The ORDERS table and a unique index are created in the USERS tablespace.

    E

    The ORDERS table is created in the USERS tablespace and a unique index is created on the OID columnin the SYSTEM tablespace.


    正确答案: B,E
    解析: 暂无解析

  • 第21题:

    单选题
    You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?()
    A

    ALTER TABLE students ADD PRIMARY KEY _ id;

    B

    ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);

    C

    ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;

    D

    ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);

    E

    ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);


    正确答案: D
    解析: 暂无解析

  • 第22题:

    多选题
    Which two statements are true about constraints? ()
    A

    The UNIQUE constraint does not permit a null value for the column.

    B

    A UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints.

    C

    The PRIMARY KEY and FOREIGN KEY constraints create a UNIQUE index.

    D

    The NOT NULL constraint ensures that null values are not permitted for the column.


    正确答案: A,B
    解析: 暂无解析

  • 第23题:

    多选题
    Which statements are correct regarding indexes? ()
    A

    When a table is dropped, the corresponding indexes are automatically dropped.

    B

    For each DML operation performed, the corresponding indexes are automatically updated.

    C

    Indexes should be created on columns that are frequently referenced as part of an expression.

    D

    A non-deferrable PRIMARY KEY or UNIQUE KEY constraint in a table automatically creates a uniqueindex.


    正确答案: B,D
    解析: 暂无解析