How do I differentiate database deletion statements from drop and delete and truncate ?, Droptruncate

Source: Internet
Author: User

How do I differentiate database deletion statements from drop and delete and truncate ?, Droptruncate

1. delete: delete rows in the data table (you can delete a row or delete all rows without deleting the data table)

Delete a row: delete from data table name where column name = value;

Delete all rows: delete * from data table name

2. drop: delete a data table or database or data table Field

Delete database: drop database Name

Delete A data table (the table structure, attributes, and indexes will also be deleted): use Database Name

Drop table 1 Name and table 2 Name

Delete data table field (column): use Database Name

Alter table data table name

Drop column field name (column name)

3. truncate: delete data in the data table (only data in the data table, not the table)

Truncate table data table name

Additional:

Data deletion speed ranking: drop> truncate> delete

Remove: deletes database files.

Alter database Mydatabase1

Remove file mydatabasedomainlog

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.