create table wb_employee_dept
(
    DEPT_ID     varchar(13)  not null
        primary key,
    DEPT_NAME   varchar(100) not null,
    PARENT_DEPT varchar(13)  not null,
    ORDER_INDEX decimal(5)   not null
);

create index WB_EMPLOYEE_DEPT_PARENT_DEPT
    on wb_employee_dept (PARENT_DEPT);

INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71Q1', 'Engineering', '0040CCVTQ71QB', 1);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71Q2', 'Recruitment', '0040CCVTQ71QJ', 2);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71Q3', 'Document Control', '0040CCVTQ71QD', 3);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71Q4', 'Executive', '0040CCVTQ71Q7', 4);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71Q5', 'Shipping and Receiving', '0040CCVTQ71Q8', 5);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71Q6', 'Facilities and Maintenance', '0040CCVTQ71Q4', 6);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71Q7', 'Administration', '-1', 7);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71Q8', 'Inventory Management', '-1', 8);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71Q9', 'Manufacturing', '-1', 9);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71QA', 'Sales and Marketing', '-1', 10);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71QB', 'Research and Development', '-1', 11);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71QC', 'Tool Design', '0040CCVTQ71QB', 12);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71QD', 'Quality Assurance', '-1', 13);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71QE', 'Sales', '0040CCVTQ71QA', 14);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71QF', 'Marketing', '0040CCVTQ71QA', 15);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71QG', 'Purchasing', '0040CCVTQ71Q8', 16);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71QH', 'Production', '0040CCVTQ71Q9', 17);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71QI', 'Production Control', '0040CCVTQ71Q9', 18);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71QJ', 'Human Resources', '0040CCVTQ71Q7', 19);
INSERT INTO ag_devmysql.wb_employee_dept (DEPT_ID, DEPT_NAME, PARENT_DEPT, ORDER_INDEX) VALUES ('0040CCVTQ71QK', 'Finance', '0040CCVTQ71Q7', 20);
