圆月山庄资源网 Design By www.vgjia.com
概述:
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', 'OPERATIONS', 'BOSTON');
emp
-- Create table create table EMP ( empno INT(4) not null, ename VARCHAR(10), job VARCHAR(9), mgr INT(4), hiredate DATE, sal decimal(7,2), comm decimal(7,2), deptno INT(2) ) engine=InnoDB charset=utf8; -- Create/Recreate primary, unique and foreign key constraints alter table EMP add constraint PK_EMP primary key (EMPNO); alter table EMP add constraint FK_DEPTNO foreign key (DEPTNO) references DEPT (DEPTNO);
insert into EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values ('7369', 'SMITH', 'CLERK', '7902','1980-12-17', '800', null, '20'); insert into EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values ('7499', 'ALLEN', 'SALESMAN', '7698', '1981-02-20', '1600', '300', '30'); insert into EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values ('7521', 'WARD', 'SALESMAN', '7698', '1981-02-22', '1250', '500', '30'); insert into EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values ('7566', 'JONES', 'MANAGER', '7839', '1981-04-02', '2975', null, '20'); insert into EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values ('7654', 'MARTIN', 'SALESMAN', '7698', '1981-09-28', '1250', '1400', '30'); insert into EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values ('7698', 'BLAKE', 'MANAGER', '7839', '1981-05-01', '2850', null, '30'); insert into EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values ('7782', 'CLARK', 'MANAGER', '7839', '1981-06-09', '2450', null, '10'); insert into EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values ('7788', 'SCOTT', 'ANALYST', '7566', '1987-06-13', '3000', null, '20'); insert into EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values ('7839', 'KING', 'PRESIDENT', null, '1981-11-17', '5000', null, '10'); insert into EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values ('7844', 'TURNER', 'SALESMAN', '7698', '1981-09-08', '1500', '0', '30'); insert into EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values ('7876', 'ADAMS', 'CLERK', '7788', '1987-06-13', '1100', null, '20'); insert into EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values ('7900', 'JAMES', 'CLERK', '7698', '1981-12-03', '950', null, '30'); insert into EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values ('7902', 'FORD', 'ANALYST', '7566', '1981-12-03', '3000', null, '20'); insert into EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) values ('7934', 'MILLER', 'CLERK', '7782', '1982-01-23', '1300', null, '10');
salgrade
create table SALGRADE ( grade INT, losal INT, hisal INT ) engine=InnoDB charset=utf8;
insert into SALGRADE(GRADE, LOSAL, HISAL) values ('1', '700', '1200'); insert into SALGRADE(GRADE, LOSAL, HISAL) values ('2', '1201', '1400'); insert into SALGRADE(GRADE, LOSAL, HISAL) values ('3', '1401', '2000'); insert into SALGRADE(GRADE, LOSAL, HISAL) values ('4', '2001', '3000'); insert into SALGRADE(GRADE, LOSAL, HISAL) values ('5', '3001', '9999');
bonus
create table BONUS ( ename VARCHAR(10), job VARCHAR(9), sal INT, comm INT ) engine=InnoDB charset=utf8 ;
总结
圆月山庄资源网 Design By www.vgjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
圆月山庄资源网 Design By www.vgjia.com
暂无评论...
更新日志
2024年12月23日
2024年12月23日
- 小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE]
- 群星《欢迎来到我身边 电影原声专辑》[320K/MP3][105.02MB]
- 群星《欢迎来到我身边 电影原声专辑》[FLAC/分轨][480.9MB]
- 雷婷《梦里蓝天HQⅡ》 2023头版限量编号低速原抓[WAV+CUE][463M]
- 群星《2024好听新歌42》AI调整音效【WAV分轨】
- 王思雨-《思念陪着鸿雁飞》WAV
- 王思雨《喜马拉雅HQ》头版限量编号[WAV+CUE]
- 李健《无时无刻》[WAV+CUE][590M]
- 陈奕迅《酝酿》[WAV分轨][502M]
- 卓依婷《化蝶》2CD[WAV+CUE][1.1G]
- 群星《吉他王(黑胶CD)》[WAV+CUE]
- 齐秦《穿乐(穿越)》[WAV+CUE]
- 发烧珍品《数位CD音响测试-动向效果(九)》【WAV+CUE】
- 邝美云《邝美云精装歌集》[DSF][1.6G]
- 吕方《爱一回伤一回》[WAV+CUE][454M]