Home > Database > Mysql Tutorial > How to update comments in mysql

How to update comments in mysql

王林
Release: 2020-09-30 13:42:42
Original
2811 people have browsed it

Mysql method to update comments: execute the [ALTER TABLE `student` COMMENT `comment content`;] statement. After completion, you can check whether the comments are updated successfully by executing the [SHOW CREATE TABLE `table_name`;] statement.

How to update comments in mysql

First create a student table, the code is as follows:

(Recommended tutorial: mysql tutorial)

CREATE TABLE `student` (
`id` int(11) AUTO_INCREMENT PRIMARY KEY COMMENT '学好',
`name` varchar(32) NOT NULL DEFAULT '' COMMENT '姓名',
`sex` tinyint(1) NOT NULL COMMENT '性别',
`age` tinyint(4) NOT NULL COMMENT '年龄',
`class` varchar(32) NOT NULL DEFAULT '' COMMENT '班级'
)ENGINE=InnODB CHARSET=utf8 COMMENT='学生表';
Copy after login

Then execute the following statement to update the comment

ALTER TABLE `student` COMMENT '学生表2.0';
Copy after login

After completion, execute the following statement to view the table comment

SHOW CREATE TABLE `student`
Copy after login

Related recommendations:php training

The above is the detailed content of How to update comments in mysql. 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