创建员工信息表
create table EmployeeInfo(
Eid int not null auto_increment primary key comment ‘员工编号’,
Ename varchar(20) comment ‘员工姓名’,
Esex char(2) comment ‘性别’,
Ebirthday date comment ‘生日’,
EAddress varchar(50) default ‘地址不详’ comment ‘地址’,
Edate date comment ‘入职时间’
)engine=InnoDB default charset=utf8;
创建员工业绩表
create table EScore(
Sid int not null auto_increment primary key comment ‘销售编号’,
id int comment ‘员工编号’,
Sdate date comment ‘销售日期’,
Smoney decimal(18,2) comment ‘销售金额’,
Sdiscount decimal(18,1) comment ‘提成比例’,
foreign key (id) references EmployeeInfo(Eid)
)engine=InnoDB default charset=utf8;
插入员工信息表数据
insert into EmployeeInfo values(1,‘张无忌’,‘男’,‘1983-11-15’,‘河南嵩山’,‘2009-10-6’),
(2,‘左冷禅’,‘男’,‘1990-3-2’,‘河北昆仑山’,‘2009-7-1’),
(3,‘段延庆’,‘男’,‘1990-9-28’,‘云南大理’,‘2012-9-12’),
(4,‘孔仲尼’,‘男’,‘1980-4-4’,‘山东曲阜’,‘2003-1-1’),
(5,‘李莫愁’,‘女’,