Home > Backend Development > PHP Tutorial > Knowledge about SQL undo indexes, tables and databases

Knowledge about SQL undo indexes, tables and databases

jacklove
Release: 2023-03-25 16:02:01
Original
1615 people have browsed it

SQL UndoIndices, tables and databases are very important in php, this article will explain them.

SQL DROP INDEX statement

We can use the DROP INDEX commandto delete the index in the table.

Syntax for Microsoft SQLJet (and Microsoft Access):

DROP INDEX index_name ON table_name

Syntax for MS SQL Server:

DROP INDEX table_name.index_name

For IBM DB2 and Oracle Syntax:

DROP INDEX index_name

For MySQL Syntax:

ALTER TABLE table_name DROP INDEX index_name

SQL DROP TABLE statement

The DROP TABLE statement is used to delete a table (table structure, Attributes and indexes will also be deleted):

DROP TABLE table name

SQL DROP DATABASE statement

The DROP DATABASE statement is used to delete the database:

DROP DATABASE database name

SQL TRUNCATE TABLE statement

If we only need to remove the data in the table, but do not delete the table itself, then what should we do? Woolen cloth?

Please use the TRUNCATE TABLE command (only delete the data in the table):

TRUNCATE TABLE table name

This article is related to SQL undoing indexes, tables and databases The knowledge is explained. For more learning materials, please pay attention to the php Chinese website to view.

Related recommendations:

SQL CREATE INDEX statement

Related knowledge about SQL DEFAULT constraints

Related knowledge about SQL CHECK constraints

The above is the detailed content of Knowledge about SQL undo indexes, tables and databases. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template