Disabling Constraints Assignment Help

Assignment Help: >> Data Integrity - Disabling Constraints

Disabling Constraints

The subsequent CREATE and ALTER TABLE statements both define and disable integrity constraints:

CREATE TABLE emp (
empno NUMBER(5) PRIMARY KEY DISABLE,   . . . );
ALTER TABLE emp
ADD PRIMARY KEY (empno) DISABLE;

The both statements describe the employee number to be primary key but initially it is disabled.
Enabling and Disabling is Defined Integrity Constraints

Use the ALTER TABLE command to

•enable a disabled constraint by using the ENABLE clause
•disable an enabled constraint by using the DISABLE clause

Enabling Disabled Constraints

The subsequent statements are the examples   of   statements   which enable disabled   integrity constraints:

ALTER TABLE dept
ENABLE CONSTRAINT dname_ukey;
ALTER TABLE dept ENABLE PRIMARY KEY, ENABLE UNIQUE (dname, loc);
The both two statements try to enable the constraints.

ALTER TABLE statements which will attempts to enable an integrity constraint fail when the rows of the table violate the integrity constraint.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd