nerdexam
Oracle

1Z0-052 · Question #241

View the Exhibit to see the data in the emp table. You created a PRIMARY KEY constraint on the empno column of the emp table, and the constraint is not deferred. Which two statements are true in…

The correct answer is B. A unique index on the empno column would be created. D. A NOT NULL constraint would be enforced on the empno column. Creating a PRIMARY KEY constraint on a column automatically enforces both uniqueness via a unique index and NOT NULL on that column.

Managing Schema Objects

Question

View the Exhibit to see the data in the emp table. You created a PRIMARY KEY constraint on the empno column of the emp table, and the constraint is not deferred. Which two statements are true in this scenario? (Choose two.)

Exhibit

1Z0-052 question #241 exhibit

Options

  • ANo index would be created or used in this case.
  • BA unique index on the empno column would be created.
  • CA CHECK constraint would be enforced on the empno column.
  • DA NOT NULL constraint would be enforced on the empno column.
  • EA bitmap unique index would be created on the empno column.

How the community answered

(47 responses)
  • A
    2% (1)
  • B
    87% (41)
  • C
    4% (2)
  • E
    6% (3)

Why each option

Creating a PRIMARY KEY constraint on a column automatically enforces both uniqueness via a unique index and NOT NULL on that column.

ANo index would be created or used in this case.

This is incorrect because Oracle always creates a unique index to support the enforcement of a PRIMARY KEY constraint.

BA unique index on the empno column would be created.Correct

Oracle automatically creates a unique B-tree index on the PRIMARY KEY column to enforce uniqueness efficiently; this index is created implicitly when the constraint is added.

CA CHECK constraint would be enforced on the empno column.

A CHECK constraint is a separate, distinct constraint type used to enforce a condition on column values; PRIMARY KEY does not imply or create a CHECK constraint.

DA NOT NULL constraint would be enforced on the empno column.Correct

A PRIMARY KEY constraint implicitly enforces NOT NULL on the constrained column because a primary key value must uniquely identify each row and cannot be null.

EA bitmap unique index would be created on the empno column.

Oracle creates a standard B-tree unique index for PRIMARY KEY constraints, not a bitmap unique index; bitmap indexes are used in data warehouse environments for low-cardinality columns.

Concept tested: Oracle PRIMARY KEY constraint behavior and implicit index creation

Source: https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/constraint_clauses.html

Topics

#PRIMARY KEY constraint#unique index#NOT NULL constraint#constraint behavior

Community Discussion

No community discussion yet for this question.

Full 1Z0-052 Practice