Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to write the sql command to delete a table

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to write the sql command about deleting tables. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

What is the sql command to delete a table?

Using the drop statement, drop table (the name of the table needs to be deleted).

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

The purpose of the drop statement is to delete content and definitions, free up space, and simply remove the entire table. It is impossible to add new data in the future unless you add a new table.

Points to note when deleting a table:

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

2. Delete deletes the unreachable wildcard * after sql, that is, delete * from, which will cause an error.

3. When delete deletes sql, the default return value is int data type. When deleting a piece of data, it returns int data 1. When deleting num data, it returns int type num.

Extended data:

SQL, structured query language (Structured Query Language), is a special purpose programming language, a database query and programming language for accessing data and querying, updating and managing relational database systems, as well as an extension of database script files.

There are many kinds and quantities of SQL statements, and many statements are often used. SQL query statement is a typical example. Whether it is high-level query or low-level query, SQL query statement is the most frequent.

Common sentences:

Create a database CREATE DATABASE database-name

Delete database drop database dbname

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

Delete new table drop table tabname

This is the end of the article on "how to write the sql command to delete the table". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report