DROP SEQUENCE employeetable_employeeid; DROP TABLE employeetable; CREATE TABLE employeetable ( name VARCHAR(128), employeeid INTEGER CONSTRAINT pk_employeetable PRIMARY KEY, reportsto INTEGER CONSTRAINT fk_employeetable_reportsto REFERENCES employeetable(employeeid) INITIALLY DEFERRED, job VARCHAR(128), email VARCHAR(128), employeetype VARCHAR(40), employeestatus VARCHAR(40), salary NUMBER, orgunit VARCHAR(128), gender VARCHAR(7), maritalstatus VARCHAR(10) ) ; CREATE SEQUENCE employeetable_employeeid START WITH 1000 NOCACHE ORDER ; CREATE OR REPLACE TRIGGER employeetable_b_i_r BEFORE INSERT ON employeetable FOR EACH ROW WHEN (NEW.employeeid IS NULL) BEGIN :NEW.employeeid := employeetable_employeeid.nextval; END; / show errors; INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Charles Madigen','4',NULL,'Chief Operating Officer','cmadigan@server.com','full time','active','26200','Management','male','married'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Ralph Brogan','192','4','Mgr Software Client Supp','rbrogan@server.com','full time','active','13700','Management','male','married'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Amanda Jones','292','192','Line Wrker A','ajones@server.com','full time','active','7050','Management','female','single'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Tammy Plant','191','4','Mgr Cap Rptg Dist','tplant@server.com','part time','terminated','18800','Management','female','single'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Ai Hong','281','191','IS T Sec Off','ahong@server.com','part time','LOA','6200','Management','male','single'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Carol Finley','190','4','Mgr Fin Rpts Budgets','cfinley@server.com','contract','active','11100','Management','male','married'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Anna Andrews','269','190','Exec Asst','aandrews@server.com','full time','LOA','8300','Management','female','single'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Andy Cavelle','268','190','Fire Sec Off','acavelle@server.com','part time','terminated','4950','Management','female','single'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Andre Robillard','267','190','Exec Asst','arobillard@server.com','contract','active','5200','Management','male','married'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Gene Porter','189','4','Mgr Tech Plng IntIS T','gporter@server.com','contract','LOA','18100','Management','female','married'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Rogine Leger','188','4','Mgr Syst P P','rleger@server.com','contract','LOA','10500','Management','female','single'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Abigail Lippman','187','4','Mgr Proj Del','alippman@server.com','full time','active','17500','Management','female','single'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Ai Ma','250','187','Dir Labour Rel','ama@server.com','part time','active','7750','Management','female','married'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('John Garrison','186','4','Mgr Site Services','jgarrison@server.com','contract','active','18600','Management','male','single'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Anna Galetti','244','186','Supp Serv Spec-HV','agaletti@server.com','full time','active','6750','Management','female','married'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Alexia Badger','239','186','Line Wrker A','abadger@server.com','full time','active','9200','Management','female','married'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Rui Shu','185','4','Mgr Proj Del','rshu@server.com','full time','LOA','16200','Management','male','single'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Abigail Meyler','222','185','Dir Mat Mgmt Admin','ameyler@server.com','part time','active','7400','Management','female','single'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Kirill Amirov','184','4','Mgr Tech Plng IntIS T','kamirov@server.com','full time','LOA','19500','Management','male','married'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Alex Parker','218','184','Secretary','aparker@server.com','part time','active','7100','Management','male','married'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Abe Freel','207','184','Stores Worker','afreel@server.com','full time','active','9000','Management','male','married'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Joan Little','183','4','Mgr Ther Gen','jlittle@server.com','full time','active','19600','Management','male','married'); INSERT INTO employeetable (name,employeeid,reportsto,job,email,employeetype,employeestatus,salary,orgunit,gender,maritalstatus) VALUES ('Tamara Kane','182','4','Mgr Site Services','tkane@server.com','part time','active','11900','Management','female','single'); COMMIT;