概述:
Oracle scott用户下四张表,比较便于做实验,验证数据,现修改为MySQL版本
1.部门表 --dept
2.员工表 --emp
3.工资等级表 --salgrade
4.奖金表 --bonus
dept
-- Create table
create table DEPT
(
deptno INT(2) not null,
dname VARCHAR(14),
loc VARCHAR(13)
) engine=InnoDB charset=utf8;
-- Create/Recreate primary, unique and foreign key constraints
alter table DEPT
add constraint PK_DEPT primary key (DEPTNO)
;
insert into DEPT(DEPTNO, DNAME, LOC)
values ('10', 'ACCOUNTING', 'NEW YORK');
insert into DEPT(DEPTNO, DNAME, LOC)
values ('20', 'RESEARCH', 'DALLAS');
insert into DEPT(DEPTNO, DNAME, LOC)
values ('30', 'SALES', 'CHICAGO');
insert into DEPT(DEPTNO, DNAME, LOC)
values ('40', &