A concise tutorial of SQL statements for Linux---DROP TRUNCATE

Source: Internet
Author: User

Sometimes we decide that we need to clear a table from the database. In fact, if we can't do that, that would be a big problem, because the database Administrator-DBA is bound to be unable to manage the database efficiently. Fortunately, SQL has the syntax to provide a DROP table to let us clear the table. The syntax for DROP TABLE is:

DROP table "table name";

If we want to clear the customer form created in SQL Create, we'll break in:

DROP TABLE Customer;



Sometimes we will need to clear all the information in a table. One way to achieve this is by the drop TABLE instruction we see on the SQL drop page. But then the whole form disappears, and it can't be used anymore. Another way is to use TRUNCATE TABLE instructions. Under this instruction, the information in the table disappears completely, but the table itself will continue to exist. The syntax for TRUNCATE TABLE is the following:

TRUNCATE table "form name";

So, if we want to clear the data within the customer form created on the SQL create table page, we will enter:

TRUNCATE TABLE Customer;

 reprint Please specify: Xiao Liu

A concise tutorial of SQL statements for Linux---DROP 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.