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