当前位置:Gxlcms > 数据库问题 > MySQL(二)

MySQL(二)

时间:2021-07-01 10:21:17 帮助过:16人阅读

TABLE table_name( column1 datatype contrai, column2 datatype, column3 datatype, ..... columnN datatype, PRIMARY KEY(one or more columns) );

  创建班级表:

create table classes(
    id int unsigned auto_increment primary key not null,
    name varchar(10)
);

  创建学生表:

create table students(
    id int unsigned primary key auto_increment not null,
    name varchar(20) default ‘‘,
    age tinyint unsigned default 0,
    height decimal(5,2),
    gender enum(,,人妖,保密),
    cls_id int unsigned default 0
)

 

  

  

 

 

 

---恢复内容结束---

MySQL(二)

标签:column   def   databases   com   image   数据库   end   default   now()   

人气教程排行