CREATE TABLE EMPAUDIT (
EMPID NUMBER,
ERRORCODE VARCHAR2(1) CHECK (ERRORCODE IN ('S', 'B', 'C', 'M')),
OPERATION VARCHAR2(1) CHECK (OPERATION IN ('I', 'U', 'D')),
WORKDEPT VARCHAR2(30),
SALARY NUMBER(10, 2),
COMM NUMBER(10, 2),
BONUS NUMBER(10, 2)
);
create table employee (EMPNO char(6), FIRSTNAME varchar(12), MIDINIT char(1), LASTNAME varchar(15), WORKDEPT char(3), PHONENO char(4), HIREDATE date, JOB char(8), EDLEVEL smallint, SEX char(1), BIRTHDATE date, SALARY decimal(9,2), BONUS decimal(9,2), COMM decimal(9,2));
-- INSERT employee DATA
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000010', 'CHRISTINE', 'I', 'HAAS', 'A00', '3978', TO_DATE('19950101', 'YYYYMMDD'), 'PRES ', 18, 'F', TO_DATE('19630824', 'YYYYMMDD'), +0152750.00,+0001000.00,+0004220.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000020', 'MICHAEL', 'L', 'THOMPSON', 'B01', '3476', TO_DATE('20031010', 'YYYYMMDD'), 'MANAGER ', 18, 'M', TO_DATE('19780202', 'YYYYMMDD'), +0094250.00,+0000800.00,+0003300.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000030', 'SALLY', 'A', 'KWAN', 'C01', '4738', TO_DATE('20050405', 'YYYYMMDD'), 'MANAGER ', 20, 'F', TO_DATE('19710511', 'YYYYMMDD'), +0098250.00,+0000800.00,+0003060.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000050', 'JOHN', 'B', 'GEYER', 'E01', '6789', TO_DATE('19790817', 'YYYYMMDD'), 'MANAGER ', 16, 'M', TO_DATE('19550915', 'YYYYMMDD'), +0080175.00,+0000800.00,+0003214.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000060', 'IRVING', 'F', 'STERN', 'D11', '6423', TO_DATE('20030914', 'YYYYMMDD'), 'MANAGER ', 16, 'M', TO_DATE('19750707', 'YYYYMMDD'), +0072250.00,+0000500.00,+0002580.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000070', 'EVA', 'D', 'PULASKI', 'D21', '7831', TO_DATE('20050930', 'YYYYMMDD'), 'MANAGER ', 16, 'F', TO_DATE('20030526', 'YYYYMMDD'), +0096170.00,+0000700.00,+0002893.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000090', 'EILEEN', 'W', 'HENDERSON', 'E11', '5498', TO_DATE('20000815', 'YYYYMMDD'), 'MANAGER ', 16, 'F', TO_DATE('19710515', 'YYYYMMDD'), +0089750.00,+0000600.00,+0002380.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000100', 'THEODORE', 'Q', 'SPENSER', 'E21', '0972', TO_DATE('20000619', 'YYYYMMDD'), 'MANAGER ', 14, 'M', TO_DATE('19801218', 'YYYYMMDD'),+0086150.00,+0000500.00,+0002092.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000110', 'VINCENZO', 'G', 'LUCCHESSI', 'A00', '3490', TO_DATE('19880516', 'YYYYMMDD'), 'SALESREP', 19, 'M', TO_DATE('19591105', 'YYYYMMDD'), +0066500.00,+0000900.00,+0003720.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000120', 'SEAN', ' ', 'O''CONNELL', 'A00', '2167', TO_DATE('19931205', 'YYYYMMDD'), 'CLERK ', 14, 'M', TO_DATE('19721018', 'YYYYMMDD'), +0049250.00,+0000600.00,+0002340.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000130', 'DELORES', 'M', 'QUINTANA', 'C01', '4578', TO_DATE('20010728', 'YYYYMMDD'), 'ANALYST ', 16, 'F', TO_DATE('19550915', 'YYYYMMDD'), +0073800.00,+0000500.00,+0001904.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000140', 'HEATHER', 'A', 'NICHOLLS', 'C01', '1793', TO_DATE('20061215', 'YYYYMMDD'), 'ANALYST ', 18, 'F', TO_DATE('19760119', 'YYYYMMDD'), +0068420.00,+0000600.00,+0002274.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000150', 'BRUCE', ' ', 'ADAMSON', 'D11', '4510', TO_DATE('20020212', 'YYYYMMDD'), 'DESIGNER', 16, 'M', TO_DATE('19770517', 'YYYYMMDD'), +0055280.00,+0000500.00,+0002022.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000160', 'ELIZABETH', 'R', 'PIANKA', 'D11', '3782', TO_DATE('20061011', 'YYYYMMDD'), 'DESIGNER', 17, 'F', TO_DATE('19800412', 'YYYYMMDD'), +0062250.00,+0000400.00,+0001780.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000170', 'MASATOSHI', 'J', 'YOSHIMURA', 'D11', '2890', TO_DATE('19990915', 'YYYYMMDD'), 'DESIGNER', 16, 'M', TO_DATE('19810105', 'YYYYMMDD'), +0044680.00,+0000500.00,+0001974.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000180', 'MARILYN', 'S', 'SCOUTTEN', 'D11', '1682', TO_DATE('20030707', 'YYYYMMDD'), 'DESIGNER', 17, 'F', TO_DATE('19790221', 'YYYYMMDD'), +0051340.00,+0000500.00,+0001707.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000190', 'JAMES', 'H', 'WALKER', 'D11', '2986', TO_DATE('20040726', 'YYYYMMDD'), 'DESIGNER', 16, 'M', TO_DATE('19820625', 'YYYYMMDD'), +0050450.00,+0000400.00,+0001636.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000200', 'DAVID', ' ', 'BROWN', 'D11', '4501', TO_DATE('20020303', 'YYYYMMDD'), 'DESIGNER', 16, 'M', TO_DATE('19710529', 'YYYYMMDD'), +0057740.00,+0000600.00,+0002217.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000210', 'WILLIAM', 'T', 'JONES', 'D11', '0942', TO_DATE('19980411', 'YYYYMMDD'), 'DESIGNER', 17, 'M', TO_DATE('20030223', 'YYYYMMDD'), +0068270.00,+0000400.00,+0001462.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000220', 'JENNIFER', 'K', 'LUTZ', 'D11', '0672', TO_DATE('19980829', 'YYYYMMDD'), 'DESIGNER', 18, 'F', TO_DATE('19780319', 'YYYYMMDD'), +0049840.00,+0000600.00,+0002387.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000230', 'JAMES', 'J', 'JEFFERSON', 'D21', '2094', TO_DATE('19961121', 'YYYYMMDD'), 'CLERK ', 14, 'M', TO_DATE('19800530', 'YYYYMMDD'), +0042180.00,+0000400.00,+0001774.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000240', 'SALVATORE', 'M', 'MARINO', 'D21', '3780', TO_DATE('20041205', 'YYYYMMDD'), 'CLERK ', 17, 'M', TO_DATE('20020331', 'YYYYMMDD'), +0048760.00,+0000600.00,+0002301.00);
INSERT INTO employee (EMPNO, FIRSTNAME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY, BONUS, COMM)
VALUES ('000250', 'DANIEL', 'S', 'SMITH', 'D21', '0961', TO_DATE('199