Вы находитесь на странице: 1из 5

Difference Between DELETE,

TRUNCATE TABLE and DROP


TABLE Command
BY
AARIJ KHAN
D-14-CS-18

DELETE
DELETE command is used to remove rows from a table.
A WHERE clause can be used to remove specific rows.
It does not delete the structure of a table.
We can use ROLLBACK command to undo it.
To Delete permanently we can use COMMIT command.
DELETE FROM <table-name>
[WHERE <conditions(s)]
DELETE FROM Employee
WHERE job=Account

TRUNCATE TABLE
TRUNCATE TABLE command is used to delete complete
data from an existing table.
We cannot use WHERE clause with this command.
This command will delete the table but not the
structure.
We cannot rollback data deleted by using this
command.
TRUNCATE TABLE <table-name>
TRUNCATE TABLE Employee

DROP TABLE
DROP TABLE command deletes data and also the
structure of the table.
We cannot use WHERE clause with this command.
We cannot rollback data deleted by using this
command.
DROP TABLE
[IF EXIST] <table-name>
DROP TABLE Employee

Thank You
Thanks for coming
Have a nice day

Вам также может понравиться