Home > Database > Mysql Tutorial > body text

Life testimony in MySQL

autoload
Release: 2021-04-06 09:21:46
Original
2120 people have browsed it

Life testimony in MySQL

Every language has its own way of commenting. The more code there is, the more obvious the importance of code comments becomes. In general, comments can appear anywhere in the program to prompt or explain the function and function of the program to the user or programmer. This article mainly introduces comments in MySQL.

1.Field comments

create table test1(
    id int primary key comment 'user_id'
)
;
Copy after login

2.Table comments

create table test2(
id int primary key,
name varchar(20) not null
)comment='table_comment';
Copy after login

3. Single-line comments

a) Single-line comments can use the # comment character, followed by the # comment character Add annotations directly. The format is as follows:

create table test3(
id int primary key,
name varchar(20) not null#偶只是一个单行属性
);
Copy after login

b) Single-line comments can use -- comment characters, needs to add a space after the -- comment character, comment to take effect. The format is as follows:

create table test4(
id int primary key,
name varchar(20) not null -- 偶是一个--的单行属性
school varchar(20) not null --偶是一个--的单行属性(错误的注释,因为--后面没有空一格)
);
Copy after login

4. Multi-line comments

create table test5(
id int primary key,
name varchar(30) not null/*鲲之大,不知其几千里也,
一锅炖不下,故有天眼*/
 );
Copy after login

Recommendation: "mysql tutorial

The above is the detailed content of Life testimony in MySQL. For more information, please follow other related articles on the PHP Chinese website!

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