Home >Database >Mysql Tutorial >How to type mysql remark (comment) code?

How to type mysql remark (comment) code?

青灯夜游
青灯夜游Original
2020-10-28 09:44:2811694browse

Method: 1. Use "/*" and "*/" to wrap the content that needs remarks, and the syntax is "/* remarks content */"; 2. Use two horizontal lines followed by the remarks content, and the syntax is "- - Remarks content", there is a space after the last horizontal line; 3. Use the comment attribute to add comments to the field, the syntax is "comment "Remarks content"".

How to type mysql remark (comment) code?

(Recommended tutorial: mysql video tutorial)

How to type mysql remark (comment) code? The following article will introduce you to some methods of remarking (commenting) code in MySQL. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

Each language has its own comment method, which is fine when the amount of code is small. As the amount of code increases, the importance of code comments becomes more and more prominent.

There are three main ways in mysql:

1. Commonly used ways, the same as those comments in css: /* Content*/

/* alter table cs modify  s_age  varchar(20) not null default '' */

2. Two Horizontal line, a common method in MySQL, generally uses this: -- Content (there is a space after the last horizontal line)

-- alter table  cs  character set utf8

 3. Comments on fields or columns are added using the attribute comment.

create table cs(

     id int UNSIGNED not null primary key auto_increment  comment "排序",

     s_name varchar(30) not null default ''  comment "姓名",

     s_age  varchar(10) UNSIGNED not null default '' comment "年龄"

)

 engine=innodb  default charset=utf8;

You can see the comment added for you in the design mode of the table. comment 'The content of your added description'

More programming related For knowledge, please visit: programming teaching! !

The above is the detailed content of How to type mysql remark (comment) code?. 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