多选题Which two statements are true about constraints? ()AThe UNIQUE constraint does not permit a null value for the column.BA UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints.CThe PRIMARY KEY and FOREIGN KEY constraints create a

题目
多选题
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.


相似考题

2.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‘)) );

更多“多选题Which two statements are true about constraints? ()AThe UNIQUE constraint does not permit a null value for the column.BA UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints.CThe PRIMARY KEY and FOREIGN KEY constraints create a”相关问题
  • 第1题:

    在设计数据库时,要充分考虑数据的完整性或准确性。下面关于primary key和unique的描述错误的是()

    • A、设为unique的列的值是不能重复的,用来唯一区别unique列的值
    • B、primary key列不可以有null值,而unique列是可以有null的
    • C、primary key列和unique列都不可以有null值
    • D、primary key用来在表中设置主键,主键列的值是可以重复的,用来唯一标识表中的每一条记录

    正确答案:C,D

  • 第2题:

    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

  • 第3题:

    For which two constraints does the Oracle Server implicitly create a unique index?()

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

    正确答案:B,E

  • 第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 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

  • 第7题:

    The InnoDB engine has a feature known as clustered indexes. Which three statements are true about clustered indexes as used in InnoDB?()

    • A、A primary key must exist for creation of a clustered index
    • B、A clustered index allows fulltext searching within InnoDB
    • C、The first unique index is always used as a clustered index and not a primary key
    • D、A clustered index provides direct access to a page containing row data
    • E、If no indexes exist, a hidden clustered index is generated based on row IDs
    • F、A primary key is used as a clustered index
    • G、A clustered index is a grouping of indexes from different tables into a global index for faster searching

    正确答案:D,E,F

  • 第8题:

    多选题
    The InnoDB engine has a feature known as clustered indexes. Which three statements are true about clustered indexes as used in InnoDB?()
    A

    A primary key must exist for creation of a clustered index

    B

    A clustered index allows fulltext searching within InnoDB

    C

    The first unique index is always used as a clustered index and not a primary key

    D

    A clustered index provides direct access to a page containing row data

    E

    If no indexes exist, a hidden clustered index is generated based on row IDs

    F

    A primary key is used as a clustered index

    G

    A clustered index is a grouping of indexes from different tables into a global index for faster searching


    正确答案: D,E,F
    解析: 暂无解析

  • 第9题:

    单选题
    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
    解析: 暂无解析

  • 第10题:

    多选题
    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
    解析: 暂无解析

  • 第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题:

    多选题
    For which two constraints does the Oracle Server implicitly create a unique index? ()
    A

    NOT NULL

    B

    PRIMARY KEY

    C

    FOREIGN KEY

    D

    CHECK

    E

    UNIQUE


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

  • 第13题:

    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

  • 第14题:

    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 nonunique index.
    • D、 It would be created and remains in a disabled state because no index is specified in the command.

    正确答案:B

  • 第15题:

    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,E

  • 第16题:

    Which two statements are true about a bitmap index? ()

    • A、It is recommended for the columns that have unique values.
    • B、It can be converted to a B-tree index by using the ALTER INDEX command.
    • C、It has a bitmap segment for each distinct value in the key column, containing a string of bits in which each bit represents the presence or absence of a key column value.
    • D、Updating the key column locks the whole bitmap segment that contains the bit for the key value to be updated.

    正确答案:C,D

  • 第17题:

    Which statement is true about loading data using the conventional path of SQL*Loader()

    • A、Redo is not generated while performing conventional path loads.
    • B、Only PRIMARY KEY, UNIQUE KEY, and NOT NULL constraints are checked.
    • C、No exclusive locks are acquired when the conventional path loads are performed.
    • D、Instead of performing transactions, SQL*Loader directly writes data blocks to the data files.
    • E、INSERT triggers are disabled before the conventional path load and reenabled at the end of the load.

    正确答案:C

  • 第18题:

    Which statement is true about loading data using the conventional path of SQL*Loader()

    • A、Redo is not generated while performing conventional path loads.
    • B、Only PRIMARY KEY, UNIQUE KEY, and NOT NULL constraints are checked.
    • C、No exclusive locks are acquired when the conventional path loads are performed.
    • D、Instead of performing transactions, SQL*Loader directly writes data blocks to the data files.
    • E、INSERT triggers are disabled before the conventional path load and reenabled at the end of the load

    正确答案:C

  • 第19题:

    多选题
    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
    解析: 暂无解析

  • 第20题:

    单选题
    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 nonunique index.

    D

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


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

  • 第21题:

    多选题
    Which two statements are true about a bitmap index? ()
    A

    It is recommended for the columns that have unique values.

    B

    It can be converted to a B-tree index by using the ALTER INDEX command.

    C

    It has a bitmap segment for each distinct value in the key column, containing a string of bits in which each bit represents the presence or absence of a key column value.

    D

    Updating the key column locks the whole bitmap segment that contains the bit for the key value to be updated.


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

  • 第22题:

    单选题
    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')) );


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

  • 第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
    解析: 暂无解析

  • 第24题:

    单选题
    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
    解析: 暂无解析