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
MySQL Modify field length
ALTER TABLE news Modify column title varchar (130);
ALTER TABLE name modify column field name type;
For example: the title field in the news table is 100 characters in length and is changed to 130 characters
ALTER TABLE
1 alter Database: modify data files
Alter database datafile 4 offline;
Alter database datafile '/opt/Oracle/datafile/users01.dbf' offline;
Alter database datafile '/opt/Oracle/datafile/users01.dbf' resize 100 m;
Alter database datafile
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
Mysql changes the table structure: add, delete, modify, and adjust the field order to add a field: altertable 'user _ movement_log 'AddcolumnGatewayIdintnotnulldefault0AFTER 'regionid' (after which field is added) Delete the field: altertable 'user _
5.6, we found that the alter column step is the same as the modify column step.
Mysql>Create Table Xs (name varchar (12), age int default 5 );Query OK, 0 rows affected (0.34 Sec)
Mysql>Insert into Xs values ('A', 4 );Query OK, 1 row affected (0.05
ALTER TABLE allows you to modify the structure of an existing table. For example, you can add or delete columns, create or eliminate indexes, change the type of existing columns, or rename columns or the table itself. You can also change the
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Alter
Table
Name
Alter
Table
-Change table attributesSyntax
Alter
Table
Table
[
*
]
Add
[
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.