How do I distinguish a database DELETE statement from drop with delete and truncate?

Source: Internet
Author: User

1. Delete: Delete rows from the datasheet (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 datasheet or database or table field

Delete database: Drop database name

Delete a data table (the structure, properties, and indexes of the table are also deleted): Use database name

drop table data table 1 name, data table 2 name

Delete a data table field (column): Use database name

ALTER TABLE data table name

Drop column field name (column name)

3. Truncate: Delete data from data table (data in data table only, not delete table)

TRUNCATE TABLE datasheet Name

Additional:

Delete data speed ranking: Drop>truncate>delete

Remove: Delete the database file

ALTER DATABASE MYDATABASE1

Remove File Mydatabase1_log

      

How do I distinguish a database DELETE statement from drop with delete and truncate?

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.