What's the difference between drop and delete? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What's the difference between drop and delete?

20th May 2017, 10:48 PM
Maria Khan
Maria Khan - avatar
2 Answers
+ 10
From Stackoverflow: "DROP will delete all data and the table structure as well. DELETE will delete the data but the table structure will remain the same and we can still rollback the data. Also with DELETE you can use the where condition i.e. to delete only certain records."
20th May 2017, 10:53 PM
Tim G
Tim G - avatar
+ 1
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. Drop: The DROP command removes a table from the database. All the tables' rows, indexes and privileges will also be removed.
11th Jun 2017, 8:33 AM
rasoul norouzi
rasoul norouzi - avatar