
每一种语言都有自己的注释方式,代码量越多,代码注释的重要性也就越明显。一般情况下,注释可以出现在程序中的任何位置,用来向用户或程序员提示或解释程序的功能及作用。本文主要介绍mysql中的注释。
1.字段注释
create table test1(
id int primary key comment 'user_id'
)
;2.表注释
create table test2( id int primary key, name varchar(20) not null )comment='table_comment';
3.单行注释
a) 单行注释可以使用#注释符,#注释符后直接加注释内容。格式如下:
create table test3( id int primary key, name varchar(20) not null#偶只是一个单行属性 );
b) 单行注释可以使用--注释符,--注释符后需要加一个空格,注释才能生效。格式如下:
create table test4( id int primary key, name varchar(20) not null -- 偶是一个--的单行属性 school varchar(20) not null --偶是一个--的单行属性(错误的注释,因为--后面没有空一格) );
4.多行注释
create table test5( id int primary key, name varchar(30) not null/*鲲之大,不知其几千里也, 一锅炖不下,故有天眼*/ );
推荐:《mysql教程》
以上就是MySQL中的人生见证的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号