1. DELETE
Basically, it's a Data Manipulation Language (DML) command. Used to delete one or
more tuples than a table. With the help of "DELETE" command we can delete all lines at once or
delete rows one by one. that is, we can use it according to terms or conditions
using the Where clause. It is relatively slower than the TRUNCATE command.
SYNTAX:
If we want to delete all table rows:
DELETE from ;
SYNTAX:
If we want to delete the table row according to the condition then we use the WHERE clause,
DELETE from WHERE ;
Notes:
Here we can use the “ROLLBACK” command to return a tuple.
2. DROP
This is a Data Definition Language (DDL) command. It is used to drop the entire table. With
the help of the "DROP" command we can drop (delete) the entire structure at once, i.e. remove elements
named schema. By using this command the existence of the entire table is completed or it is said to be missing.
SYNTAX
If we want to drop the table.
DROP table ;
Notes:
Here we cannot restore the table by using the “ROLLBACK” command.
3. TRUNCATE
It is also a Data Definition Language (DDL) command. It is used to delete all relation rows
(table) at once. With the help of "TRUNCATE" command we cannot delete a single line because here
WHERE clause is not used. By using this command the existence of all table rows is lost. It's relative
faster than delete command because it deletes all lines fast.
SYNTAX
If we want to use truncate :
TRUNCATE ;
Notes:
Here we cannot return table tuples by using “ROLLBACK” command.