--delete from table name
--1> Just delete some data in the table, the table structure is still there.
--2>Delete can delete a portion of data with a where clause, e.g. DELETE FROM Student WHERE sAge > 20
--3> Autonumbering does not revert to its initial value.
--truncate table table name
--1>truncate statement cannot be followed by the where condition, cannot be deleted according to the condition, only all data can be deleted.
--2> Auto-numbering reverts to its initial value.
--3> Using truncate to delete all data in a table is much more efficient than delete, because truncate uses the minimum method to record logs.
--4>truncate deletes data without triggering delete trigger.
--drop table table name
--1> Delete the table itself, that is, delete all the data and table structure (columns, constraints, views, keys) in the table.
Auto numbering explained:
1 Automatic numbering will only grow forward, not backward. 2 If there is an error in inserting data, the automatic number will also increase, and the next time it is inserted, the number will be "skipped". 3. Automatic numbering columns cannot be modified manually.
|