SQL Data Definition Language PDF
SQL Data Definition Language PDF
Introduction to DDL
Syntax:
CREATE TABLE <table_name>
( column_name1 datatype,
column_name2 datatype,
.
.
.
column_name_n datatype
);
Syntax:
DROP TABLE <table_name>;
OR
DROP DATABASE <database_name>;
OR
OR
OR
OR
Example:
RENAME TABLE emp TO employee;
5. TRUNCATE COMMAND
• TRUNCATE command is used to delete all the rows from the table
permanently.
• It removes all the records from a table, including all spaces allocated for
the records.
• This command is same as DELETE command, but TRUNCATE command
does not generate any rollback data.
Syntax:
TRUNCATE TABLE <table_name>;
Example:
TRUNCATE TABLE employee;