CHANGE CONSTRAINTS
USING ALTER COMMAND:
CREATE TABLE PRODUCT1
(
PID NUMBER(4),
PNAME VARCHAR(5),
QTY NUMBER(3),
DESCP VARCHAR(30),
CONSTRAINT
PRODUCT1_PK PRIMARY KEY(PID),
CONSTRAINT
PRODUCT1_UNIQUE UNIQUE(PNAME),
)
SYSNTAX TO DROP
CONSTRAINT:
ALTER TABLE TABLE_NAME
DROP CONSTRAINTS CONSTRAINTS_NAME;
EX:
ALTER TABLE PRODUCT1
DROP CONSTRAINTS PRODUCT1_PK
SYSNTAX TO ADD
CONSTRAINT:
ALTER TABLE TABLE_NAME
ADD CONSTRAINTS CONSTRAINTS_NAME(COLUMN_NAME);
EX:
ALTER TABLE PRODUCT1
ADD CONSTRAINT PRODUCT1_PK PRIMARY KEY(PID);
SYSNTAX TO ENABLE
CONSTRAINT:
ALTER TABLE TABLE_NAME
ENABLE CONSTRAINTS CONSTRAINTS_NAME;
EX:
ALTER TABLE PRODUCT1
ENABLE CONSTRAINTS PRODUCT1_PK
SYNTAX TO DISABLE
CONSTRAINT:
ALTER TABLE TABLE_NAME
DISABLE CONSTRAINTS CONSTRAINTS_NAME;
EX:
ALTER TABLE PRODUCT1
DISABLE CONSTRAINTS PRODUCT1_PK