DB2 Alter Table introduction and use of normal Table modification and creation, you need to consider the following two situations: 1. when data is stored in a table, you can only modify the Data Type of the column to a compatible data type, or keep
Alter table t move and alter table t shrink space can both be used for CIDR and CIDR to reduce the HWM,It can also be used to eliminate Row Chaining and Row Migration ),But there are the following differences:1) Using alter table move will contract
Name
Alter table -- change the definition of a table
Synopsis
ALTER TABLE [ ONLY ] name [ * ] action [, ... ]ALTER TABLE [ ONLY ] name [ * ] RENAME [ COLUMN ] column TO new_columnALTER TABLE name RENAME TO new_nameALTER TABLE name SET
This section describes how to use the alter table statement to modify a table. The alter table statement can execute the following tasks:
1. Add, modify, or delete Columns
2. add or delete Constraints
3. enable or disable Constraints
1. Add a column
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Alter
Table
Name
Alter
Table
-Change table attributesSyntax
Alter
Table
Table
[
*
]
Add
[
First, basic usage
1. Add Column
ALTER TABLE Tbl_name add col_name type
For example, add a column of weight to the pet table,
Mysql>alter table Pet Add weight int;
2. Delete Column
ALTER TABLE Tbl_name drop col_
MySQL database ALTER command explanation, MySQL ALTER command explanation
MySQL is a Relational Database Management System. This so-called "Relational" can be understood as "tables". A Relational Database consists of one or more tables.
When we need
In MySQL5.5 and previous versions, performing an alter operation on a large table (over millions of records) in a running production environment is a difficult task. Because the table and lock table will be rebuilt, affecting the user's use. It is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.