亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長(zhǎng)資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    mysql怎么添加注釋

    mysql添加注釋的方法:1、使用“alter table 表名 modify 字段名 類型 約束 comment '注釋內(nèi)容';”語句為字段添加注釋;2、用“alter table 表名 comment '注釋內(nèi)容';”語句為表添加注釋。

    mysql怎么添加注釋

    本教程操作環(huán)境:windows7系統(tǒng)、mysql8版本、Dell G3電腦。

    MySql如何添加注釋

    **在mysql數(shù)據(jù)庫(kù)中,數(shù)據(jù)庫(kù)表和字段的注釋用屬性comment來添加。*

    1.為字段添加注釋:

    1)創(chuàng)建新表時(shí),在表的字段約束后面添加注釋。

    例如:

    create table users(id int(11) primary key comment ‘用戶id’);

    這里的users為表名,id為字段名,int(11)為類型,primary key為約束。

    2)如果是已經(jīng)建好的表,可以用修改字段的命令,加上comment屬性。

    例如:

    alter table users modify name varchar(20)not null comment ‘用戶名’;

    這里的users為表名,name為字段名, varchar(20)為類型,not null 為約束。

    2.為表添加注釋:

    1)創(chuàng)建新表時(shí),在括號(hào)外面寫表注釋。

    例如:

    create table users ( id int(11) primary key comment '用戶id ') comment=‘用戶信息表’;

    2)已經(jīng)建好的表,可以修改表的時(shí)候加上注釋。

    例如:

    alter table users comment ‘用戶信息表’;

    這里的users為表名。

    3.查看表注釋的方法

    show create table users;

    這里users為表名。

    4.查看字段注釋的方法

    show full columns from users;

    這里users為表名。

    贊(0)
    分享到: 更多 (0)
    網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)