DDL DRL DML TCL DCL
Create select Insert Commit Grant
Alter Update Rollback Revoke
Truncate Delete
Drop Save point
Rename Insert all
Flashback merge
Purge
DDL Commands
• DDL Stands for Data Definition Language
• It deals with meta data [Data Definitions]such as table name,
column name, data type, field size, constraint name, constraint
type ...etc.
• We have no need to use “commit” command after using a “DDL
Command”. All DDL commands are auto committed.
• DDL Commands provided by Oracle-SQL are:
▪ Create
▪ Alter
▪ Drop
▪ Truncate
▪ Rename
▪ Flashback
▪ Purge
CREATE: This command is used to create the database or its objects (like
table, index, function, views, store procedure, and triggers).
2) Alter Command:
• It is a DDL Command.
• It is used to change the structure of database objects like tables,
views, and indexes ...etc.
3) Drop Command:
• It is a DDL Command.
• It is used to drop [delete] the database objects like tables, views,
and
Indexes ...etc.
Drop Table <Table_Name> [Purge];
4) Flashback Command:
• It is a DDL Command.
• It is used to recollect the dropped database objects from recycle
bin.
Flashback Table <Table_Name> to before drop [rename to
<new_name>];
5) Purge Command:
• It is a DDL Command.
• It is used to remove a dropped database object from Recycle Bin.
Purge Table <Table_Name>;
6) Truncate Command:
• It is a DDL Command.
• It is used to remove all records from a table.
• It does not remove structure of the table.
• It cannot be used to remove one record (or) a set of records from
table.
Truncate Table <Table_Name>;
7) Rename Command:
• It is a DDL Command.
• It is used to rename the data base objects like tables.
Rename <Old_Name> to <New_Name>;