create table DEPT ( deptno NUMBER(2) not null, dname VARCHAR2(20), loc VARCHAR2(13) ); alter table DEPT add constraint PK_DEPT primary key (DEPTNO); c ...
create table DEPT ( deptno NUMBER(2) not null, dname VARCHAR2(20), loc VARCHAR2(13) ); alter table DEPT add constraint PK_DEPT primary key (DEPTNO); create table TEACHER ( tno NUMBER(4) not null, tname VARCHAR2(30) not null, tid CHAR(18), gendar CHAR(3), birthdate DATE, job VARCHAR2(20), hiredate DATE, sal NUMBER(7,2), deptno NUMBER(2), mgrno NUMBER(4), comm NUMBER(7,2) ); insert into DEPT (deptno, dname, loc) values (40, '人力部', '北京海澱'); insert into DEPT (deptno, dname, loc) values (30, '產品部', '北京海澱'); insert into DEPT (deptno, dname, loc) values (20, '招生部', '上海虹橋'); insert into DEPT (deptno, dname, loc) values (10, '研究院', '北京海澱'); insert into DEPT (deptno, dname, loc) values (50, '系統部', '北京昌平'); commit; insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1002, '趙輝', '110101760609001 ', '男', to_date('09-06-1976', 'dd-mm-yyyy'), '考試專員', to_date('23-05-2006 02:40:40', 'dd-mm-yyyy hh24:mi:ss'), 29370.95, 40, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1003, '楊利樂', '110101198705256045', '女', to_date('25-05-1987', 'dd-mm-yyyy'), '考試專員', to_date('24-11-2011 16:08:38', 'dd-mm-yyyy hh24:mi:ss'), 7134.32, 40, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1004, '王益輝', '110101199108154770', '男', to_date('15-08-1991', 'dd-mm-yyyy'), '營銷專員', to_date('16-01-2012 03:12:43', 'dd-mm-yyyy hh24:mi:ss'), 30737.36, 20, null, 2300.00); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1006, '秦璐璐', '110101199004153068', '女', to_date('14-04-1990', 'dd-mm-yyyy'), '運維工程師', to_date('20-06-2012 00:47:09', 'dd-mm-yyyy hh24:mi:ss'), 9013.25, 10, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1007, '梁改煥', '110101196911206548', '女', to_date('20-11-1969', 'dd-mm-yyyy'), '講師', to_date('13-06-2006 23:07:02', 'dd-mm-yyyy hh24:mi:ss'), 8664.16, 50, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1008, '馮愛仙', '110101196804021521', '女', to_date('02-04-1968', 'dd-mm-yyyy'), '講師', to_date('06-06-2006 13:41:50', 'dd-mm-yyyy hh24:mi:ss'), 29936.29, 30, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1009, '秦亞傑', '110101196312163531', '男', to_date('16-12-1963', 'dd-mm-yyyy'), '崗位分析師', to_date('13-07-2005 06:32:30', 'dd-mm-yyyy hh24:mi:ss'), 24991.44, 30, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1010, '劉浩星', '110101198806283516', '男', to_date('28-06-1988', 'dd-mm-yyyy'), '考試專員', to_date('24-11-2011 16:08:38', 'dd-mm-yyyy hh24:mi:ss'), 22645.92, null, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1011, '秦春葉', '110101197103033540', '女', to_date('03-03-1971', 'dd-mm-yyyy'), '網路營銷師', to_date('07-07-2007 16:02:04', 'dd-mm-yyyy hh24:mi:ss'), 31653.23, 50, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1012, '陳水花', '110101192811043026', '女', to_date('04-11-1928', 'dd-mm-yyyy'), '考試專員', to_date('29-01-2005 23:21:59', 'dd-mm-yyyy hh24:mi:ss'), 29773.37, 20, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1013, '馬付妮', '110101195806133522', '女', to_date('13-06-1958', 'dd-mm-yyyy'), '研發', to_date('17-11-2004 08:54:04', 'dd-mm-yyyy hh24:mi:ss'), 17041.60, 40, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1015, '劉得安', '110101195210083518', '男', to_date('08-10-1952', 'dd-mm-yyyy'), '考試專員', to_date('13-03-2005 23:25:37', 'dd-mm-yyyy hh24:mi:ss'), 30356.99, 20, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1016, '高利芹', '110101198307276020', '女', to_date('27-07-1983', 'dd-mm-yyyy'), '崗位分析師', to_date('24-11-2011 16:08:38', 'dd-mm-yyyy hh24:mi:ss'), 25751.36, null, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1017, '劉志剛', '110101197806164493', '男', to_date('16-06-1978', 'dd-mm-yyyy'), '運維工程師', to_date('10-05-2008 13:46:33', 'dd-mm-yyyy hh24:mi:ss'), 22344.73, 20, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1018, '高心立', '110101194102076011', '男', to_date('07-02-1941', 'dd-mm-yyyy'), '網路營銷師', to_date('03-03-2005 15:17:07', 'dd-mm-yyyy hh24:mi:ss'), 19981.02, 40, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1019, '徐麗', '11010119790809354X', '男', to_date('09-08-1979', 'dd-mm-yyyy'), '研發', to_date('09-12-2009 18:37:22', 'dd-mm-yyyy hh24:mi:ss'), 10950.33, 30, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1021, '劉志紅', '110101196504284452', '男', to_date('28-04-1965', 'dd-mm-yyyy'), '崗位分析師', to_date('20-09-2011 10:51:33', 'dd-mm-yyyy hh24:mi:ss'), 7122.60, 20, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1022, '孔鵬飛', '110101198603304014', '男', to_date('30-03-1986', 'dd-mm-yyyy'), '人力資源師', to_date('24-11-2011 16:08:38', 'dd-mm-yyyy hh24:mi:ss'), 7045.28, 40, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1023, '李建坡', '110101731107301 ', '男', to_date('07-11-1973', 'dd-mm-yyyy'), '網路營銷師', to_date('04-07-2009 06:28:20', 'dd-mm-yyyy hh24:mi:ss'), 21133.91, 50, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1024, '馮愛敏', '110101196907283840', '女', to_date('18-07-1969', 'dd-mm-yyyy'), '營銷專員', to_date('12-09-2005 22:41:06', 'dd-mm-yyyy hh24:mi:ss'), 3360.91, 20, null, 50000.00); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1025, '薛栓成', '110101400710051 ', '男', to_date('10-07-1940', 'dd-mm-yyyy'), '網路營銷師', to_date('03-09-2007 14:55:06', 'dd-mm-yyyy hh24:mi:ss'), 12136.65, 40, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1026, '牛偉偉', '11010119851120602X', '女', to_date('20-11-1985', 'dd-mm-yyyy'), '崗位分析師', to_date('24-11-2011 16:08:38', 'dd-mm-yyyy hh24:mi:ss'), 6622.66, 30, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1027, '郭香雲', '110101196010154525', '女', to_date('15-10-1960', 'dd-mm-yyyy'), '網路營銷師', to_date('03-05-2005 13:01:22', 'dd-mm-yyyy hh24:mi:ss'), 26436.18, 50, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1028, '朱花枝', '110101195605154028', '女', to_date('15-05-1956', 'dd-mm-yyyy'), '研發', to_date('11-09-2007 07:41:01', 'dd-mm-yyyy hh24:mi:ss'), 10095.22, 50, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1029, '李崗', '110101196505163095', '男', to_date('16-05-1965', 'dd-mm-yyyy'), '崗位分析師', to_date('09-11-2007 17:26:38', 'dd-mm-yyyy hh24:mi:ss'), 23928.84, 30, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1030, '李軍會', '110101197706152524', '男', to_date('15-06-1977', 'dd-mm-yyyy'), '營銷專員', to_date('12-05-2007 19:48:21', 'dd-mm-yyyy hh24:mi:ss'), 3492.19, 20, null, 25000.00); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1031, '孫龍舉', '110101198908306037', '男', to_date('30-08-1989', 'dd-mm-yyyy'), '運維工程師', to_date('24-11-2011 16:08:38', 'dd-mm-yyyy hh24:mi:ss'), 4323.84, 30, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1032, '韓朝旭', '110101199003270513', '男', to_date('27-03-1900', 'dd-mm-yyyy'), '人力資源師', to_date('11-09-2010 17:54:30', 'dd-mm-yyyy hh24:mi:ss'), 13740.92, 40, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1033, '孫少光', '110101198809274535', '男', to_date('27-09-1988', 'dd-mm-yyyy'), '網路營銷師', to_date('24-11-2011 16:08:38', 'dd-mm-yyyy hh24:mi:ss'), 19778.62, 50, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1035, '鄧香敏', '110101196607163109', '女', to_date('16-07-1966', 'dd-mm-yyyy'), '人力資源師', to_date('12-04-2007 17:47:14', 'dd-mm-yyyy hh24:mi:ss'), 29463.38, 40, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1037, '霍振方', '110101198411070014', '男', to_date('07-11-1984', 'dd-mm-yyyy'), '講師', to_date('24-11-2011 16:08:38', 'dd-mm-yyyy hh24:mi:ss'), 23731.31, 40, 1087, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1038, '許雙鴿', '110101781217004 ', '女', to_date('17-12-1978', 'dd-mm-yyyy'), '網路營銷師', to_date('05-09-2007 18:45:00', 'dd-mm-yyyy hh24:mi:ss'), 16512.52, 30, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1040, '張春紅', '110101197806176089', '女', to_date('17-06-1978', 'dd-mm-yyyy'), '運維工程師', to_date('21-11-2004 06:52:30', 'dd-mm-yyyy hh24:mi:ss'), 31728.83, 10, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1041, '盧玉蓮', '110101510606004 ', '女', to_date('06-06-1951', 'dd-mm-yyyy'), '人力資源師', to_date('30-03-2009 17:05:45', 'dd-mm-yyyy hh24:mi:ss'), 17596.43, 40, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1042, '李軍會', '110101197706152524', '男', to_date('15-06-1977', 'dd-mm-yyyy'), '講師', to_date('13-06-2008 03:24:47', 'dd-mm-yyyy hh24:mi:ss'), 8443.59, 50, 1008, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1043, '朱水娃', '110101195210033512', '男', to_date('03-10-1952', 'dd-mm-yyyy'), '講師', to_date('11-10-2009 03:40:53', 'dd-mm-yyyy hh24:mi:ss'), 9123.09, 30, 1008, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1045, '高大榮', '110101195504073528', '女', to_date('07-04-1955', 'dd-mm-yyyy'), '考試專員', to_date('07-12-2005 14:56:05', 'dd-mm-yyyy hh24:mi:ss'), 4000.00, 10, null, null); insert into TEACHER (TNO, TNAME, TID, GENDAR, BIRTHDATE, JOB, HIREDATE, SAL, DEPTNO, MGRNO, COMM) values (1046, '秦付根', '110101195301034035', '男', to_date('03-01-1953', 'dd-mm-yyyy'), '講師', to_date('10-12-2004 22:51:51', '