您的位置:首页 > 数据库 > MySQL

Mysql命令create table:创建数据表

2016-06-04 07:54 459 查看
create table命令用来创建数据表。

create table命令格式:create table <表名> (<字段名1> <类型1> [,..<字段名n> <类型n>]);

例如,建立一个名为MyClass的表:
字段名数字类型数据宽度是否为空是否主键自动增加默认值
idint4primary keyauto_increment 
namechar20   
sexint4  0
degreedouble16   
mysql> create table MyClass(
    > id int(4) not null primary key auto_increment,
    > name char(20) not null,
    > sex int(4) not null default '0',
    > degree double(16,2));
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: