nerdexam
Oracle

1Z0-047 · Question #140

Evaluate the following SQL statements that are issued in the given order: CREATE TABLE emp (emp_no NUMBER(2) CONSTRAINT emp_emp_no_pk PRIMARY KEY, enameVARCHAR2(15), salary NUMBER(8,2), mgr_no…

The correct answer is C. It would remain disabled and has to be enabled manually using the ALTER TABLE command. See the full explanation below for the reasoning.

Question

Evaluate the following SQL statements that are issued in the given order:

CREATE TABLE emp (emp_no NUMBER(2) CONSTRAINT emp_emp_no_pk PRIMARY KEY, enameVARCHAR2(15), salary NUMBER(8,2), mgr_no NUMBER(2) CONSTRAINT emp_mgr_fk REFERENCES emp); ALTER TABLE emp DISABLE CONSTRAINT emp_emp_no_pk CASCADE; ALTER TABLE emp ENABLE CONSTRAINT emp_emp_no_pk; What would be the status of the foreign key EMP_MGR_FK?

Options

  • AIt would be automatically enabled and deferred.
  • BIt would be automatically enabled and immediate.
  • CIt would remain disabled and has to be enabled manually using the ALTER TABLE command.
  • DIt would remain disabled and can be enabled only by dropping the foreign key constraint and re-creating it.

How the community answered

(25 responses)
  • A
    4% (1)
  • B
    8% (2)
  • C
    72% (18)
  • D
    16% (4)

Community Discussion

No community discussion yet for this question.

Full 1Z0-047 Practice