关系型数据库:建立在关系模型基础上,由多张相互连接的二维表组成的数据库
SQL语句
![](https://img-blog.csdnimg.cn/direct/921239583b4a42209391756d8f71d80c.png)
![](https://img-blog.csdnimg.cn/direct/d689c2ecc2ee4c2da78c432924f92291.png)
![](https://img-blog.csdnimg.cn/direct/d3523b366f8a4a6eba439b80815be61e.png)
![](https://img-blog.csdnimg.cn/direct/63d41a1d54ca4c8482883369b2068a4e.png)
mysql> use itheim;
Database changed
mysql> create table tb_user(
-> id int comment 'bianhao',
-> name varchar(50) comment 'xingming',
-> age int comment 'nianling',
-> gender varchar(1) comment 'xingbie'
-> ) comment 'userbiao';
![](https://img-blog.csdnimg.cn/direct/db2d289f1fa84da1b94d4d11aa16500a.png)
![](https://img-blog.csdnimg.cn/direct/583005a960134169b72ed61015d1c390.png)
![](https://img-blog.csdnimg.cn/direct/c3e451528a904fca94404da9e3d91e00.png)
![](https://img-blog.csdnimg.cn/direct/1590b52eb8c449fda84f1c705efb18b6.png)
数据类型
![](https://img-blog.csdnimg.cn/direct/fd22a56157394c3a997f10498f49ce97.png)
![](https://img-blog.csdnimg.cn/direct/0163fd6142744cfda48bffa0c4ed80cb.png)
![](https://img-blog.csdnimg.cn/direct/6f30423aa0964a60b78ede12527dc8a1.png)
create table emp(
id int comment '编号',
workno varchar(10) comment '工号',
name varchar(10) comment '姓名',
gender char(1) comment '性别',
age tinyint unsigned comment '年龄', //定义为无符号范围
idcard char(18) comment '身份证号',
entrydate date comment '入职时间'
) comment '员工表';
总结
![](https://img-blog.csdnimg.cn/direct/9d30146ba3f94d14b0a57ef672e02f4b.png)