Home >Database >SQL >What is the sql command to delete a table?

What is the sql command to delete a table?

hzc
hzcOriginal
2020-06-17 16:35:1047071browse

What is the sql command to delete a table?

What is the sql command to delete a table?

Use the drop statement to drop table (the name of the table that needs to be deleted).

drop is to delete the entire table, and delete is to delete the contents of the table.

The role of the drop statement: delete content and definitions, release space, in short, remove the entire table. It is impossible to add new data in the future unless a new table is added.

Things to note when deleting a table:

1. If you delete an application table alias, delete must be followed by the corresponding alias and then the table name, otherwise an error will be reported.

2. The wildcard * cannot be connected after delete delete sql, that is, delete * from, which will cause an error.

3. The default return value of delete deletion sql is int data type. When a piece of data is deleted, int data 1 is returned. When num pieces of data are deleted, int type num is returned.

What is the sql command to delete a table?

Extended information:

SQL is Structured Query Language (Structured Query Language), which is a special-purpose programming language and a database query. and programming language for accessing data and querying, updating, and managing relational database systems; it is also the extension for database script files.

There are many types and quantities of SQL statements, and many statements are often used. SQL query statements are a typical example. Whether it is a high-level query or a low-level query, the requirements for SQL query statements are most frequently.

Commonly used statements:

Create database CREATE DATABASE database-name

Delete database drop database dbname

Create new table create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..)

Delete new table drop table tabname

Recommended tutorial: "sql tutorial"

The above is the detailed content of What is the sql command to delete a table?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn