Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between drop and delete database?

Tags:

sql

What is the difference between drop and delete database?

like image 948
BreakHead Avatar asked Mar 16 '10 06:03

BreakHead


2 Answers

Difference between DELETE and DROP commands

Delete: The DELETE command is used to remove rows from a table. A WHERE clause can be used to only remove some rows. If no WHERE condition is specified, all rows will be removed. After performing a DELETE operation you need to COMMIT or ROLLBACK the transaction to make the change permanent or to undo it. Note that this operation will cause all DELETE triggers on the table to fire.

Drop: The DROP command removes a table from the database. All the tables' rows, indexes and privileges will also be removed. No DML triggers will be fired. The operation cannot be rolled back.

like image 155
Ravi Vanapalli Avatar answered Oct 12 '22 23:10

Ravi Vanapalli


Simply: a DELETE command removes matching rows, a DROP command removes the entire table.

like image 28
gpmcadam Avatar answered Oct 13 '22 00:10

gpmcadam