1.SQL语句代码
show databases ;
create database if not exists table1;
use table1;
drop database if exists table1;
create table tb_user(
id int primary key comment 'ID,唯一标识',
username varchar(20) not null unique comment '用户名',
name varchar(10) not null comment '姓名',
age int comment '年龄',
sex varchar(1) default '男' comment '性别'
)comment'用户表';
create table student(
id int unsigned primary key auto_increment comment'学号,主键',
username varchar(20) not null comment'用户名',
sex varchar(1) default'男'comment'性别',
age int comment'年龄',
email varchar(11) unique comment'邮箱'
)comment '学生表';
create table corse(
id varchar(12) primary key comment '课程id',
corse_name varchar(20) not null unique comment '课程名',
score decimal(4, 1) comment '学分'
)comment '课程表';
create table employee(
id int primary key auto_increment comment '员工id',
name varchar(20) not null comment '姓名',
deparment varchar(20) default '未分配' comment '部门',
data date comment '入职日期',
income decimal(7, 2) comment '工资',
telephone char(11) comment '手机号',
Creation_Date datetime comment '创建时间'
)comment '员工表';
2.今日思维导图