Home » SQL & PL/SQL » SQL & PL/SQL » how to write it shorter or easier? (SQL hierarchic query)
how to write it shorter or easier? [message #420540] Mon, 31 August 2009 04:17 Go to next message
Rozpalacz
Messages: 1
Registered: August 2009
Junior Member
I have to get sth like this (King salary = sum of all employees with King //
Greenberg = sum of Greenberg Faviet, Chen, Sciarra, Urman //
Sciarra = sum od Sciarra, Urman) I hope You know what I mean Very Happy

EMPLOYEE_ID            NAME                      SALARY                 TEAM
-----------------------------------------------------------------------------------------
100                    King                      685000                 King
101                    Kochhar                   87400                     Kochhar
108                    Greenberg                 29200                        Greenberg
109                    Faviet                    4200                            Faviet
110                    Chen                      4200                            Chen
111                    Sciarra                   4200                            Sciarra
112                    Urman                     4200                            Urman
113                    Popp                      4200                            Popp
200                    Whalen                    4400                         Whalen
203                    Mavris                    6500                         Mavris
204                    Baer                      10000                        Baer
205                    Higgins                   20300                        Higgins
206                    Gietz                     8300                            Gietz
102                    De Haan                   45800                     De Haan
.
.
.
.
205                    Higgins                   20300                        Higgins
206                    Gietz                     8300                            Gietz
                       ## SALARY SUM ##    685000                 ##############
108 rows selected


my query:

select a.employee_id, a.name, a.salary, (lpad(' ', (b.poziom-1) * 3,' ') || name) as team from
(
  select sum(salary) salary, name, employee_id from
  (
    SELECT CONNECT_BY_ROOT salary salary, last_name as name, employee_id
      FROM employees
      CONNECT BY employee_id = PRIOR manager_id)
    group by name, employee_id
  ) a,
(
select level poziom, employee_id from employees start with employee_id = 100 CONNECT by prior employee_id = manager_id
) b
where a.employee_id = b.employee_id
union
select null, '## SALARY SUM ##', sum(salary), '##############' from employees



SQL:


CREATE TABLE employees
    ( employee_id    NUMBER(6)
    , first_name     VARCHAR2(20)
    , last_name      VARCHAR2(25)
	 CONSTRAINT     emp_last_name_nn  NOT NULL
    , email          VARCHAR2(25)
	CONSTRAINT     emp_email_nn  NOT NULL
    , phone_number   VARCHAR2(20)
    , hire_date      DATE
	CONSTRAINT     emp_hire_date_nn  NOT NULL
    , job_id         VARCHAR2(10)
	CONSTRAINT     emp_job_nn  NOT NULL
    , salary         NUMBER(8,2)
    , commission_pct NUMBER(2,2)
    , manager_id     NUMBER(6)
    , department_id  NUMBER(4)) ;


Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (100,'Steven','King','SKING','515.123.4567',to_timestamp('87/06/17 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'AD_PRES',40000 ,null,null, 90 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (101,'Neena','Kochhar','NKOCHHAR','515.123.4568',to_timestamp('89/09/21 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'AD_VP',17000 ,null, 100, 90 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (102,'Lex','De Haan','LDEHAAN','515.123.4569',to_timestamp('93/01/13 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'AD_VP',17000 ,null, 100, 90 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (103,'Alexander','Hunold','AHUNOLD','590.423.4567',to_timestamp('90/01/03 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'IT_PROG',9000 ,null, 102, 60 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (104,'Bruce','Ernst','BERNST','590.423.4568',to_timestamp('91/05/21 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'IT_PROG',6000 ,null, 103, 60 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (105,'David','Austin','DAUSTIN','590.423.4569',to_timestamp('97/06/25 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'IT_PROG',4800 ,null, 103, 60 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (106,'Valli','Pataballa','VPATABAL','590.423.4560',to_timestamp('98/02/05 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'IT_PROG',4800 ,null, 103, 60 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (107,'Diana','Lorentz','DLORENTZ','590.423.5567',to_timestamp('99/02/07 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'IT_PROG',4200 ,null, 103, 60 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (108,'Nancy','Greenberg','NGREENBE','515.124.4569',to_timestamp('94/08/17 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'FI_MGR',8200 ,null, 101, 100 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (109,'Daniel','Faviet','DFAVIET','515.124.4169',to_timestamp('94/08/16 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'FI_ACCOUNT',4200 ,null, 108, 100 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (110,'John','Chen','JCHEN','515.124.4269',to_timestamp('97/09/28 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'FI_ACCOUNT',4200 ,null, 108, 100 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (111,'Ismael','Sciarra','ISCIARRA','515.124.4369',to_timestamp('97/09/30 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'FI_ACCOUNT',4200 ,null, 108, 100 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (112,'Jose Manuel','Urman','JMURMAN','515.124.4469',to_timestamp('98/03/07 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'FI_ACCOUNT',4200 ,null, 108, 100 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (113,'Luis','Popp','LPOPP','515.124.4567',to_timestamp('99/12/07 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'FI_ACCOUNT',4200 ,null, 108, 100 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (114,'Den','Raphaely','DRAPHEAL','515.127.4561',to_timestamp('94/12/07 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'PU_MAN',11000 ,null, 100, 30 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (115,'Alexander','Khoo','AKHOO','515.127.4562',to_timestamp('95/05/18 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'PU_CLERK',3100 ,null, 114, 30 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (116,'Shelli','Baida','SBAIDA','515.127.4563',to_timestamp('97/12/24 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'PU_CLERK',2900 ,null, 114, 30 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (117,'Sigal','Tobias','STOBIAS','515.127.4564',to_timestamp('97/07/24 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'PU_CLERK',2800 ,null, 114, 30 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (118,'Guy','Himuro','GHIMURO','515.127.4565',to_timestamp('98/11/15 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'PU_CLERK',2600 ,null, 114, 30 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (119,'Karen','Colmenares','KCOLMENA','515.127.4566',to_timestamp('99/08/10 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'PU_CLERK',2500 ,null, 114, 30 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (120,'Matthew','Weiss','MWEISS','650.123.1234',to_timestamp('96/07/18 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_MAN',8000 ,null, 100, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (121,'Adam','Fripp','AFRIPP','650.123.2234',to_timestamp('97/04/10 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_MAN',8200 ,null, 100, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (122,'Payam','Kaufling','PKAUFLIN','650.123.3234',to_timestamp('95/05/01 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_MAN',7900 ,null, 100, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (123,'Shanta','Vollman','SVOLLMAN','650.123.4234',to_timestamp('97/10/10 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_MAN',6500 ,null, 100, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (124,'Kevin','Mourgos','KMOURGOS','650.123.5234',to_timestamp('99/11/16 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_MAN',5800 ,null, 100, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (125,'Julia','Nayer','JNAYER','650.124.1214',to_timestamp('97/07/16 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',3200 ,null, 120, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (126,'Irene','Mikkilineni','IMIKKILI','650.124.1224',to_timestamp('98/09/28 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',2700 ,null, 120, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (127,'James','Landry','JLANDRY','650.124.1334',to_timestamp('99/01/14 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',2400 ,null, 120, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (128,'Steven','Markle','SMARKLE','650.124.1434',to_timestamp('00/03/08 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',2200 ,null, 120, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (129,'Laura','Bissot','LBISSOT','650.124.5234',to_timestamp('97/08/20 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',3300 ,null, 121, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (130,'Mozhe','Atkinson','MATKINSO','650.124.6234',to_timestamp('97/10/30 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',2800 ,null, 121, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (131,'James','Marlow','JAMRLOW','650.124.7234',to_timestamp('97/02/16 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',2500 ,null, 121, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (132,'TJ','Olson','TJOLSON','650.124.8234',to_timestamp('99/04/10 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',2100 ,null, 121, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (133,'Jason','Mallin','JMALLIN','650.127.1934',to_timestamp('96/06/14 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',3300 ,null, 122, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (134,'Michael','Rogers','MROGERS','650.127.1834',to_timestamp('98/08/26 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',2900 ,null, 122, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (135,'Ki','Gee','KGEE','650.127.1734',to_timestamp('99/12/12 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',2400 ,null, 122, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (136,'Hazel','Philtanker','HPHILTAN','650.127.1634',to_timestamp('00/02/06 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',2200 ,null, 122, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (137,'Renske','Ladwig','RLADWIG','650.121.1234',to_timestamp('95/07/14 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',3600 ,null, 123, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (138,'Stephen','Stiles','SSTILES','650.121.2034',to_timestamp('97/10/26 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',3200 ,null, 123, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (139,'John','Seo','JSEO','650.121.2019',to_timestamp('98/02/12 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',2700 ,null, 123, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (140,'Joshua','Patel','JPATEL','650.121.1834',to_timestamp('98/04/06 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',2500 ,null, 123, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (141,'Trenna','Rajs','TRAJS','650.121.8009',to_timestamp('95/10/17 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',3500 ,null, 124, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (142,'Curtis','Davies','CDAVIES','650.121.2994',to_timestamp('97/01/29 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',3100 ,null, 124, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (143,'Randall','Matos','RMATOS','650.121.2874',to_timestamp('98/03/15 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',2600 ,null, 124, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (144,'Peter','Vargas','PVARGAS','650.121.2004',to_timestamp('98/07/09 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'ST_CLERK',2500 ,null, 124, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (145,'John','Russell','JRUSSEL','011.44.1344.429268',to_timestamp('96/10/01 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_MAN',14000, 0.4, 100, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (146,'Karen','Partners','KPARTNER','011.44.1344.467268',to_timestamp('97/01/05 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_MAN',13500, 0.3, 100, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (147,'Alberto','Errazuriz','AERRAZUR','011.44.1344.429278',to_timestamp('97/03/10 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_MAN',12000, 0.3, 100, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (148,'Gerald','Cambrault','GCAMBRAU','011.44.1344.619268',to_timestamp('99/10/15 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_MAN',11000, 0.3, 100, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (149,'Eleni','Zlotkey','EZLOTKEY','011.44.1344.429018',to_timestamp('00/01/29 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_MAN',10500, 0.2, 100, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (150,'Peter','Tucker','PTUCKER','011.44.1344.129268',to_timestamp('97/01/30 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',10000, 0.3, 145, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (151,'David','Bernstein','DBERNSTE','011.44.1344.345268',to_timestamp('97/03/24 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',9500, 0.25, 145, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (152,'Peter','Hall','PHALL','011.44.1344.478968',to_timestamp('97/08/20 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',9000, 0.25, 145, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (153,'Christopher','Olsen','COLSEN','011.44.1344.498718',to_timestamp('98/03/30 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',8000, 0.2, 145, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (154,'Nanette','Cambrault','NCAMBRAU','011.44.1344.987668',to_timestamp('98/12/09 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',7500, 0.2, 145, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (155,'Oliver','Tuvault','OTUVAULT','011.44.1344.486508',to_timestamp('99/11/23 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',7000, 0.15, 145, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (156,'Janette','King','JKING','011.44.1345.429268',to_timestamp('96/01/30 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',10000, 0.35, 146, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (157,'Patrick','Sully','PSULLY','011.44.1345.929268',to_timestamp('96/03/04 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',9500, 0.35, 146, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (158,'Allan','McEwen','AMCEWEN','011.44.1345.829268',to_timestamp('96/08/01 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',9000, 0.35, 146, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (159,'Lindsey','Smith','LSMITH','011.44.1345.729268',to_timestamp('97/03/10 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',8000 ,0.3, 146, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (160,'Louise','Doran','LDORAN','011.44.1345.629268',to_timestamp('97/12/15 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',7500, 0.3, 146 ,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (161,'Sarath','Sewall','SSEWALL','011.44.1345.529268',to_timestamp('98/11/03 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',7000 ,0.25 ,146 ,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (162,'Clara','Vishney','CVISHNEY','011.44.1346.129268',to_timestamp('97/11/11 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',10500 ,0.25 ,147,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (163,'Danielle','Greene','DGREENE','011.44.1346.229268',to_timestamp('99/03/19 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',9500, 0.15 ,147,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (164,'Mattea','Marvins','MMARVINS','011.44.1346.329268',to_timestamp('00/01/24 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',7200, 0.1 ,147 ,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (165,'David','Lee','DLEE','011.44.1346.529268',to_timestamp('00/02/23 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',6800, 0.1,147 ,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (166,'Sundar','Ande','SANDE','011.44.1346.629268',to_timestamp('00/03/24 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',6400 ,0.1 ,147 ,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (167,'Amit','Banda','ABANDA','011.44.1346.729268',to_timestamp('00/04/21 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',6200, 0.1 ,147 ,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (168,'Lisa','Ozer','LOZER','011.44.1343.929268',to_timestamp('97/03/11 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',11500, 0.25 ,148 ,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (169,'Harrison','Bloom','HBLOOM','011.44.1343.829268',to_timestamp('98/03/23 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',10000, 0.2, 148, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (170,'Tayler','Fox','TFOX','011.44.1343.729268',to_timestamp('98/01/24 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',9600, 0.2, 148 ,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (171,'William','Smith','WSMITH','011.44.1343.629268',to_timestamp('99/02/23 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',7400,0.15, 148, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (172,'Elizabeth','Bates','EBATES','011.44.1343.529268',to_timestamp('99/03/24 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',7300 ,0.15 ,148 ,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (173,'Sundita','Kumar','SKUMAR','011.44.1343.329268',to_timestamp('00/04/21 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',6100, 0.1, 148,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (174,'Ellen','Abel','EABEL','011.44.1644.429267',to_timestamp('96/05/11 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',11000, 0.3, 149 ,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (175,'Alyssa','Hutton','AHUTTON','011.44.1644.429266',to_timestamp('97/03/19 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',8800, 0.25 ,149 ,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (176,'Jonathon','Taylor','JTAYLOR','011.44.1644.429265',to_timestamp('98/03/24 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',8600, 0.2 ,149 ,80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (177,'Jack','Livingston','JLIVINGS','011.44.1644.429264',to_timestamp('98/04/23 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',8400, 0.2, 149, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (178,'Kimberely','Grant','KGRANT','011.44.1644.429263',to_timestamp('99/05/24 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',7000 ,0.15, 149 ,null,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (179,'Charles','Johnson','CJOHNSON','011.44.1644.429262',to_timestamp('00/01/04 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SA_REP',6200 ,0.1, 149, 80 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (180,'Winston','Taylor','WTAYLOR','650.507.9876',to_timestamp('98/01/24 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',3200 ,null, 120 ,50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (181,'Jean','Fleaur','JFLEAUR','650.507.9877',to_timestamp('98/02/23 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',3100 ,null, 120, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (182,'Martha','Sullivan','MSULLIVA','650.507.9878',to_timestamp('99/06/21 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',2500 ,null, 120, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (183,'Girard','Geoni','GGEONI','650.507.9879',to_timestamp('00/02/03 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',2800 ,null, 120, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (184,'Nandita','Sarchand','NSARCHAN','650.509.1876',to_timestamp('96/01/27 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',4200 ,null, 121, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (185,'Alexis','Bull','ABULL','650.509.2876',to_timestamp('97/02/20 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',4100 ,null, 121, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (186,'Julia','Dellinger','JDELLING','650.509.3876',to_timestamp('98/06/24 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',3400 ,null, 121 ,50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (187,'Anthony','Cabrio','ACABRIO','650.509.4876',to_timestamp('99/02/07 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',3000 ,null, 121, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (188,'Kelly','Chung','KCHUNG','650.505.1876',to_timestamp('97/06/14 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',3800 ,null, 122, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (189,'Jennifer','Dilly','JDILLY','650.505.2876',to_timestamp('97/08/13 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',3600 ,null, 122 ,50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (190,'Timothy','Gates','TGATES','650.505.3876',to_timestamp('98/07/11 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',2900 ,null, 122, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (191,'Randall','Perkins','RPERKINS','650.505.4876',to_timestamp('99/12/19 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',2500 ,null, 122, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (192,'Sarah','Bell','SBELL','650.501.1876',to_timestamp('96/02/04 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',4000 ,null, 123, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (193,'Britney','Everett','BEVERETT','650.501.2876',to_timestamp('97/03/03 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',3900 ,null, 123 ,50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (194,'Samuel','McCain','SMCCAIN','650.501.3876',to_timestamp('98/07/01 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',3200 ,null, 123, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (195,'Vance','Jones','VJONES','650.501.4876',to_timestamp('99/03/17 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',2800 ,null, 123 ,50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (196,'Alana','Walsh','AWALSH','650.507.9811',to_timestamp('98/04/24 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',3100 ,null, 124, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (197,'Kevin','Feeney','KFEENEY','650.507.9822',to_timestamp('98/05/23 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',3000 ,null, 124 ,50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (198,'Donald','OConnell','DOCONNEL','650.507.9833',to_timestamp('99/06/21 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',2600 ,null, 124, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (199,'Douglas','Grant','DGRANT','650.507.9844',to_timestamp('00/01/13 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'SH_CLERK',2600 ,null, 124, 50 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (200,'Jennifer','Whalen','JWHALEN','515.123.4444',to_timestamp('87/09/17 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'AD_ASST',4400 ,null, 101 ,10 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (201,'Michael','Hartstein','MHARTSTE','515.123.5555',to_timestamp('96/02/17 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'MK_MAN',13000 ,null, 100, 20 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (202,'Pat','Fay','PFAY','603.123.6666',to_timestamp('97/08/17 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'MK_REP',6000 ,null, 201 ,20 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (203,'Susan','Mavris','SMAVRIS','515.123.7777',to_timestamp('94/06/07 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'HR_REP',6500 ,null, 101, 40 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (204,'Hermann','Baer','HBAER','515.123.8888',to_timestamp('94/06/07 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'PR_REP',10000 ,null, 101, 70 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (205,'Shelley','Higgins','SHIGGINS','515.123.8080',to_timestamp('94/06/07 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'AC_MGR',12000 ,null, 101, 110 ,null);
Insert into EMPLOYEES (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL,PHONE_NUMBER,HIRE_DATE,JOB_ID,SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID,TEST) values (206,'William','Gietz','WGIETZ','515.123.8181',to_timestamp('94/06/07 00:00:00,000000000','RR/MM/DD HH24:MI:SS,FF'),'AC_ACCOUNT',8300 ,null, 205 ,110 ,null);

[Updated on: Mon, 31 August 2009 04:44]

Report message to a moderator

Re: how to write it shorter or easier? [message #420556 is a reply to message #420540] Mon, 31 August 2009 05:22 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL> col ename format a15
SQL> break on report
SQL> compute sum label Total of sal on report
SQL> select rpad('-',2*(level-1),'-')||ename ename, sal,
  2         ( select sum(sal) 
  3           from emp e2 
  4           connect by prior empno = mgr 
  5           start with e2.empno = emp.empno ) sum_sal
  6  from emp
  7  connect by prior empno = mgr
  8  start with mgr is null
  9  /
ENAME                  SAL    SUM_SAL
--------------- ---------- ----------
KING                  5000      25275
--JONES               2975      10875
----SCOTT             3000       4100
------ADAMS           1100       1100
----FORD              3000       3800
------SMITH            800        800
--BLAKE               2850       9400
----ALLEN             1600       1600
----WARD              1250       1250
----MARTIN            1250       1250
----TURNER            1500       1500
----JAMES              950        950
                ----------
Total                25275

12 rows selected.

Regards
Michel
Previous Topic: ORACLE 10G data insertion
Next Topic: partial Updation of coumn ! (merged 4)
Goto Forum:
  


Current Time: Sat Dec 10 17:01:17 CST 2016

Total time taken to generate the page: 0.19800 seconds