Home > Database > SQL > What is the sql statement to modify the table name?

What is the sql statement to modify the table name?

烟雨青岚
Release: 2020-07-03 16:00:45
Original
32877 people have browsed it

The sql statement to modify the table name is the "ALTER TABLE" statement. The basic syntax is: "ALTER TABLE

[modify options]"; the "ALTER TABLE" statement is used to modify the design of an existing table; columns can be added, modified, or deleted in an existing table.

What is the sql statement to modify the table name?

The sql statement to modify the table name is the "ALTER TABLE" statement.

The ALTER TABLE statement is used to add, modify, or delete columns in an existing table. Alter statement When modifying the Sql Server table structure, the Alter statement is commonly used. Some commonly used alter statements are listed below

ALTER TABLE statement is used to modify the design of an existing table.

Basic syntax: ALTER TABLE

[Modify options]

ALTER TABLE table ADD COLUMN field type[(size)] [NOT NULL] [constraint index]
Copy after login
ALTER TABLE table ADD CONSTRAINT multifieldindex  
Copy after login
ALTER TABLE table DROP COLUMN field
Copy after login
ALTER TABLE table DROP CONSTRAINT indexname
Copy after login

Description:

## The #table parameter is used to specify the name of the table to be modified.

ADD COLUMN is a reserved word of SQL. Use it to add fields to the table.

ADD CONSTRAINT is a reserved word of SQL. Use it to add an index to the table.

DROP COLUMN is a reserved word of SQL. Use it to delete fields from the table.

DROP CONSTRAINT is a reserved word of SQL. Use it to delete the index from the table.

field specifies the name of the field to be added or deleted.

The type parameter specifies the data type of the new field.

The size parameter is used to specify the length of the text or binary field.

The indexname parameter specifies the name of the multi-field index to be deleted.

Recommended tutorial: "

sql video tutorial"

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

Related labels:
sql
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