Enabling Constraints
The following CREATE TABLE and ALTER TABLE statements both describe and enable integrity constraints:
CREATE TABLE emp (
empno NUMBER(5) PRIMARY KEY, . . . );
ALTER TABLE emp1
ADD PRIMARY KEY (empno);
The above two statements add the primary key constraint. The first adds the primary key constraint at the time of creation of the table. The next statement tries to add the constraint after the table is created. In this query if the records are not available and the constraint is added. If records are already present then the ALTER TABLE statement will fail.