Page 6 - DDL and DML Commands
P. 6
Removing Table Components
Alter table Emp1
Drop Primary Key, drop foreign key fk_1, drop column deptno;
Alter table dept
Drop primary key cascade;
(The cascade option drops any foreign keys that reference the primary key.)
Destroying Table
Condition is table must be empty.
If Exists – checks if the table exists
Syntax is:
DROP TABLE [IF EXISTS]<table name>
Example:
DROP TABLE IF EXISTS stream
COMMIT command makes the changes permanent in a table.