Delete command
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.
Example:
101 Id is deleted in user table
1 | Delete from user where id= '101' ; |
delete all records from user table
1 | Delete * from user ; |
The DROP command removes a table from the database. All the tables' rows, indexes and privileges will also be removed.the operation cannot be rolled back.
Example:
user table removed from a database
1 | Drop table user ; |
Truncate command
TRUNCATE removes all rows from a table,not a whole table from a database. The operation cannot be rolled back.
Example:
all rows delete from a user table not a table delete
1 | truncate table user ; |
No comments:
Post a Comment