Home  >  Article  >  Database  >  How to update comments in mysql

How to update comments in mysql

王林
王林Original
2020-09-30 13:42:422757browse

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='学生表';

Then execute the following statement to update the comment

ALTER TABLE `student` COMMENT '学生表2.0';

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

SHOW CREATE TABLE `student`

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!

Statement:
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