mysql--(入门语句9--建表案例)

#建表案例

给一班的学生建立一个档案表;

姓名:char(3)
年龄:tinyint
email:varchar(30)
tel:char(11)
简介intro:varchar(1000)
毕业薪水salary:decimal(7,2)

入学日期riq:date

//id int primary key auto_increment,加这个id,是原数据,主键,为了区分
//engine=存储引
//charset=字符集

create table ban(
id int primary key auto_increment,
name char(3) not null default '',
age tinyint unsigned not null default 0,
email varchar(30) not null default '',
tel char(11) not null default '',
salary decimal(7,2) not null default '1800.68',
riq date not null default '2017-01-01'
)charset utf8;

desc ban;

这样一个表就建好了。略略略,接下来不会有后续,骗你是小狗。汪~微笑

猜你喜欢

转载自blog.csdn.net/qq_32823673/article/details/80453600