SlideShare a Scribd company logo
SUNTURST
         CONSULTING INC


     DATABASE PROJECT
                     BY

                 GROUP 12




               DBST 652
University of Maryland University College
              Summer 2011
      Saturday, November 26, 2011
Contents

Deliverable 1 – Project Charter........................................................................................... 2
Deliverable 2 - ERD............................................................................................................ 5
Deliverable 3 - Data Definition Language ........................................................................ 12
Deliverable 4 – Data Manipulation Language .................................................................. 18
Database Snappshot .......................................................................................................... 49
Deliverable 5 - SQL Queries............................................................................................. 62
Deliverable 6 -Database Maintenance Scripts .................................................................. 69
Deliverable 7 – Functons & Stored Procedure ................................................................ 75
Deliverable 8 -Explain Tool.............................................................................................. 79
Deliverable 9 - Object-Relational Exercises ..................................................................... 82
References ......................................................................................................................... 87




                                                                                                                                          1
Deliverable 1 – Project Charter

Database Objective

       Objective of this project is to create an Employee Database which will store

information about employees working for SunTrust Consulting Inc. SunTrust is IT

consulting company which has assigned many projects to its several employees.

        This database will contain all the information about the employees working for

the SunTrust , such as Employee’s ID, SSN, first name, Date of birth, home address,

office phone number, emergency contacts, department, languages, salary etc. It also

stores the information about project such as project ID, project name, the assigned

employee and the number of hours worked by each employee.

       Currently, SunTrust Company is using an access, single user database, to record

employee data. Moving this to multiuser database will enable individual employees to

access most of the employee’s data online. At the same time, company executive can see

the cost associated with each project.



Purpose and benefits

       This multi user database will help HR to ease their workload by giving employees

access to their data via web and letting them update their information. Moreover

employees will be able to search the database and find contact information about other

employees like addresses and phone numbers. Managers will have access to their

employee’s data and project’s cost which can be used to make a better business decision.


                                                                                           2
Furthermore, mangers would be able to create and finalize reports of projects like the

average cost of each projects and total salary paid to each employee.



Technical Detail

        This database will run in the UMUC Unix server dbcourse2 which will be

accessed via PortalPutTTY terminal emulator using SSH network protocol. The software

that would be used is Oracle 10g. Data definition language (DDL) would be used to

create the database. Data manipulation language (DML) and Transaction control

language (TCL) would also be utilized to manipulate the database and make changes or

undo transactions to the database.

Tools
Microsoft Visio 2010 and Oracle Data Modeler would be used to create the Entity

relationship diagram (ERD). Notepad +++ and notepad would be used to write and edit

SQL statements. Microsoft Project 2007 would be used to create the project schedule.



Project Schedule

Please open the Microsoft Project file for complete project schedule attached with this
document.




                                                                                          3
Deliverable         Deliverable Schedule             Member   Complete By
    1         Project Charter                                    June 5

     2        ERD                                               June 12

     3        Data Definition Language                          June 19

                                                                June 26
     4        Data Manipulation Language
                                                                 July 1
     5        SQL Queries

                                                                 July 8
     6        Database Maintenance Scripts

                                                                July 24
     7        Functons & Stored Procedure
                                                                July 29
     8        Explain Tool

                                                                July 29
     9        Object Relational Exercises

    10        Lab Project Report                                August 5


                                Table 1 Project Schedule




                                                                            4
Deliverable 2 - ERD


                                                                Dependent
                                                          PK     Depnd_Num

                                                                 First_Name
                                                                 Last_Name
                                                                 Dep_Dob
                                                          FK1    Emp_ID
                                                                 Depend_Type


                    Associated
                                                                                                 Department
                                                                                          PK       Dept_ID

                                                                            Employs                Dept_Name
                                                                                                   Dept_Phone
                                                                                          FK1      Dept_Mgr_ID
                                                                                                   Dept_Ext


                                                                                    Managed




                               Works
                                                                                    Assignment
                    EMPLOYEE
                                                                              PK    Assignment_Num
              PK      Emp_ID                  Manager                                                                                       Project
                                                                                    Assign_Date                                       PK    Proj_Num
                      First_Name                                                    Assign_Hours
                      Last_Name                                                     Cost                                              FK1   Proj_Mrg_ID
                      SNN                                                     FK1   Emp_ID                                                  Proj_Name
                      DOB                                                     FK2   Proj_Num                                                Due_Date
                      Emp_Rate                                  Associated
                                   Assigned
                      Gender
              FK1     Job_Code                                                                                                                        Managed
              FK2     Dept_ID
                                       Manager


                                                                                                                       Contact
                                                               Associated                                        PK    Contact_ID

Associated                                                                                                       FK1   Emp_ID
                                                                                                                       Address
                                                                                                                       Apt_Num
                                                                                                                       City
                                                                                                                       H_State
                    Job                                                                                                Phone_Home
                                                                                                                       Phone_Mobile
         PK    Job_Code                                                                                                Phone_Work

               Description




                                                                                                                                                                5
ERD Description

   Entity                             Description

   Emplpoyee                          Stores data about an employee

   Assignment                         Stores data relating to an assignment assigned to
                                      an employee
   Project                            Stores data of a project
   Department                         Stores data of a department

   Dependent                          Stores data of the dependent assiocated with an
                                      employee

   Job                                Stores data of a job
   Contact                            Stores the contact of an employee


                            Table 2 ERD Description




                                    Constraints
    Primary keys

           Name             Object                               Description

    dept_dept_id_pk       Department             Adds the primary key constraint to the
                                                           department table.

   job_Job_Code_pk            Job              Adds the primary key constraint to the job
                                                                table.

   PK_Proj_Num_pk           Project             Adds the primary key constraint to the
                                                             project table.
         Emp_id_pk         Employee             Adds the primary key constraint to the
                                                            employee table.
assign_assigment_num_pk   Assignment            Adds the primary key constraint to the
                                                           assignment table
   con_contact_id_pk        Contact            Adds the primary key constraint to contact
                                                                 table.
depend_Depend_num_pk       Dependent            Adds the primary key constraint to the
                                                           dependent table.

                          Table 3 Primary Key Contraints
                                                                                            6
Foreign Keys


      Name                Object                       Description

dept_dept_m8gr_id       Department     Adds the FK constraint linking Employee to
                                       Department using Employee PK column
                                       (Emp_ID) & Department (Dept_Mgr_ID)
                                       column.


proj_proj_mgr_id_fk       Project      Adds the FK constraint linking Employee to
                                       Project using Employee PK column
                                       (Emp_ID) & Project (Proj_Mrg_ID)
                                       column.


  emp_dept_id_fk                        Adds the FK constraint linking Department
                         Employee       to Employee using Department PK column
                                         (Dept_ID) & Employe(Dept_ID) column.


 emp_job_code_fk                       Add the FK constraint linking Job to
                                       Employee using Job PK column (Job_Code)
                      Table 4 Foreign Key Employee (Job_Code) column.
                                       & Constraint


assign_Emp_Num_fk                      Adds the FK constraint linking Employee to
                        Assignment     Assignment using Employee PK column
                                       (Emp_ID) & Assignment (Emp_ID)
                                       column.


  assign_Proj_Num                      Adds the FK constraint linking Project to
                                       Assignment using Project PK column
                                       (Proj_Num) & Assignment (Proj_Num)
                                       column.

Depend_Emp_id_fk         Dependent     Adds the FK constraint linking Employee to
                                       Dependent using Employee PK column
                                       (Emp_ID) & Dependent(Emp_ID) column.


  con_emp_id_fk           Contact      Adds the FK constraint linking Employee to
                                       Contact using Employee Pk column
                                       (Emp_ID) & Contact (Emp_ID) column.



                                                                                    7
                       Table 5 Not Null Constraint
Not Null




           Name           Object                          Description

       dept_ex_nn       Department   Adds the not null constraint to Dept_Ex column.


     dept_phone_nn                   Adds the not null constraint to Dept_Phone column.


     dept_name_nn                    Adds the not null constraint to Dept_Name column.


   job_description_nn      Job       Adds the not null constraint to the job_description
                                     column.


  proj_proj_mgr_id_nn    Project     Adds the not null constraint to the Proj_Mrg_ID
                                     column.

   proj_proj_name_nn
                                     Adds the not null constraint to the
                                     Proj_Name column.

    proj_due_date_nn
                                     Adds the not null constraint to Due_Date column.

   emp_last_name_nn                  Adds the not null constraint to Last_Name column.


      emp_dob_nn                     Adds the not null constraint to DOB column.

                        Employee
   emp_emp_rate_nn                   Adds the not null constraint to Emp_Rate
                                     Column.
                                     Adds the Dept_ID column not null constraint
       dept_id_nn
                                     Adds the not null constraint to First_Name column.
   emp_First_name_nn


      enp_job_code                   Adds the not null constraint to the Job_code column.




                                                                                            8
emp_gender_nn                     Adds the not null constraint to the Gender column.

  assign_emp_num_nn                   Adds the not null constraint to the Emp_ID column.

   assign_hours_nn      Assignment
                                      Adds the not null constraint to Assign_Hours
                                      column.
   assign_project_nn
                                      Adds the not null constraint to Proj_Num column.

 depend_first_name_nn                 Adds the not null constraint to First_Name column.

                        Dependent
 depend_last_name_nn                  Adds the not null constraint to Last_Name column.


 depend_dep_dob_mn                    Adds the not null constraint to the Dep_Dob
                                      column.

  depend_Emp_id_nn                    Adds the not null constraint to the Emp_ID column.


depend_Depend_Type_nn                 Adds the not null constraint to Depend_Type
                                      column.


                           Table 6 Not Null Constraint




                                                                                           9
Relationships

Relationship Name           Entities         Relationship                    Description

  Emp_Dpet Rel       Employee & Department       1:M        One or more employee works for a
                                                            department.

                                                            A department employes one or more
                                                            employees

  Dep_Emp Rel        Department& Employee        1:1        One and only one employee is the manger of
                                                            a department.

                                                            A department is managed by an employee.

                                                            An employment is assigned to zero or more
 Emp_Assign Rel      Employee & Assignment       1:M        assignment(s).

                                                            Zero or more assignment(s) is assiocated with
                                                            an employee.

Assign_Project Rel    Assignment & Project       1:M        One or more assignments can be assiocated
                                                            with a project.

                                                            A project can be assiocated with one or more
                                                            assignments.

  Cont_Emp Rel        Contact & Employee         1:M        An employee is assiocated with one or more
                                                            contact listing(s).

                                                            One or more contact listing(s) is assiocated
                                                            with an employee.

  Emp_Job Rel           Employee & Job           1:M        One or more employees can be assiocated
                                                            with the same job type.

                                                            A job type is assiocated with one or more
                                                            employees.


Depend_Emp Rel       Dependent & Employee        1:1        One and only one depedent may be assiocated
                                                            with an employee.




                                                                                                     10
Proj_Emp Rel   Project & Employee             1:1      One and only one employee is the manager of
                                                       a project.

                                                       A project is managed by an employee.


                                    Table 7 Relationships




                                                                                              11
Deliverable 3 - Data Definition Language



/* creates the department table */

CREATE TABLE DEPARTMENT
  (
  Dept_ID Number ,
  Dept_Name VARCHAR2(50),
  Dept_Phone Number,
       Dept_Mgr_ID Number ,
  Dept_Ext Number
 );

/* add the primary key constraint */

 Alter table department
  add constraint dept_dept_id_pk primary key (dept_id);

/* add the not null constraint */


Alter table department
        modify (dept_ext constraint dept_ex_nn not null)
        modify ( dept_phone constraint dept_phone_nn not null)
        modify (dept_name constraint dept_name_nn not null);

/* adds the foreign key constraint to the department table */

Alter table department
 add constraint dept_dept_mgr_id_fk foreign key (dept_mgr_id) references employee
(emp_id);

/* creates the unique number for the pk columns */
create sequence dept_dept_id_seq
start with 0400
increment by 5
Nocycle ;

/* creates the job table */

CREATE TABLE JOB
(


                                                                                    12
Job_code Number,
  Description VARCHAR2(50) CONSTRAINT job_description_nn not null
);

/*end of statement*/


/* creates the primary key constraint*/

Alter table job
add constraint job_Job_Code_pk PRIMARY KEY(Job_Code)

/*end*/


/* creates the table project*/

CREATE TABLE PROJECT
(
  Proj_Num Number ,
       Proj_Mgr_ID Number,
  Proj_name VARCHAR2(50),
  Due_Date DATE
       );

/* end */

/* creates pk constraint for the project table */


Alter table project
add CONSTRAINT PK_Proj_Num_pk PRIMARY KEY(Proj_Num);


/* create the foreign key constraint for project table */

Alter table project
  add constraint proj_proj_mgr_id_fk foreign key (proj_mgr_id) references employee
(emp_id);

/* end of sql */

/* creates the null constraints for project table * */

Alter table project
 modify( proj_mgr_id constraint proj_proj_mgr_id_nn not null )
 modify (proj_name constraint proj_proj_name_nn not null)
 modify( due_date constraint proj_due_date_nn not null);

/* end sql */

                                                                                     13
/* creates the employee table */

 CREATE TABLE EMPLOYEE
 (Emp_id Number ,
  First_Name VARCHAR2(50),
  Last_Name VARCHAR2(50),
  SSN VARCHAR2(11),
  Dob DATE,
  Emp_Rate Number(10,2),
  Dept_ID number ,
  Gender varchar2(6),
  Job_Code number
   );
/* end */


/* add the primary key constraint */

Alter table employee
add constraint Emp_id_pk PRIMARY KEY(Emp_id);

/* adds the null constraints to the columnn */

Alter table employee
modify( last_name constraint emp_last_name_nn not null)
modify ( dob constraint emp_dob_nn not null)
modify ( emp_rate constraint emp_emp_rate_nn not null)
modify ( dept_id constraint dept_id_nn not null)
modify( first_name constraint emp_First_name_nn NOT NULL)
modify ( job_code constraint emp_job_code_nn not null)
 modify ( gender constraint emp_gender_nn not null);


/* adds the foreign key constraint */



Alter table employee
  add CONSTRAINT EMP_dept_id_fk FOREIGN KEY(Dept_ID) REFERENCES
DEPARTMENT(Dept_ID) ;

Alter table employee
  add CONSTRAINT Emp_job_code_fk FOREIGN KEY(Job_Code) REFERENCES
JOB(Job_Code);

/* sql ends */




                                                                    14
/* creates the assignment table*/


 CREATE TABLE ASSIGNMENT
  (
   Assignment_Num Number,
   Assign_Date DATE,
   Assign_Hours Number(10,2),
   Cost Number(20,2),
  Emp_id number,
 Proj_Num number
  );
/*ends*/

/* creates the constraints for assignment */

 Alter table ASSIGNMENT
  add constraint assign_assigment_num_pk primary key ( Assignment_Num );

 Alter table ASSIGNMENT
   modify ( assign_date constraint assign_emp_num_nn not null)
         modify ( assign_hours constraint assign_hours_nn not null)
         modify ( emp_id constraint assign_emp_num not null)
         modify ( proj_num constraint assign_project_nn not null );

  Alter table ASSIGNMENT
         add CONSTRAINT assign_Emp_Num_fk FOREIGN KEY(Emp_id)
REFERENCES EMPLOYEE(Emp_id)

 Alter table ASSIGNMENT
   add CONSTRAINT assign_Proj_Num FOREIGN KEY(Proj_num) REFERENCES
PROJECT(Proj_num);

/*ends*/

/* creates the table for contact*/

 Create table contact
 ( contact_id number,
   Emp_ID number,
   Address varchar2(50),
        Apt_Num varchar2(50),
        City varchar2(30),
        H_State varchar2(3),
        Phone_Home number,
        phone_Mobile number,
        Phone_Work number
);



                                                                           15
/* end */


/* creates the pk constraint */
 Alter table contact
 add constraint con_contact_id_pk primary key ( contact_id, emp_id);

 /* creates the fk constraint */

Alter table contact
 add constraint con_emp_id_fk foreign key (emp_id) references employee (emp_id);

/* add column */

Alter table contact
 add email_office varchar2(40);



/*creates the sequence value for the assignment pk value*/

create sequence assign_assign_num_seq
start with 05020
increment by 12
Nocycle

/*ends*/


 /* change sequence */
 Alter sequence emp_ssn_seq
   increment by 589874



/*produce unique numbers for pk columns. The database creates the number */

create sequence emp_emp_id_seq
start with 030404
increment by 130
Nocycle ;

/* create unique number for ssn*/

create sequence emp_ssn_seq
start with 201342019
increment by 1200
Nocycle

/* creates unique constraint for ssn*/

                                                                                   16
Alter table employee
add constraint emp_emp_ssn_uk unique (ssn);

/* changed the sequence value*/

Alter sequence emp_ssn_seq
increment by 498989
Nocycle;

/*ends*/


/* creates the unique sequence for pk column */

Create sequence con_contact_id_seq
start with 00020
increment by 123;
nocycle;

/* creates the unique number for project_num */


create sequence proj_proj_num_seq
start with 0900
increment by 5
Nocycle

/* end */




                                                  17
Deliverable 4 – Data Manipulation Language


/* inserts records into the department*/

Insert into department( dept_id, dept_name, dept_phone, dept_ext)
    values ( dept_dept_id_seq.nextval, 'Quality Assurance', 2122028259, 8260);

Insert into department( dept_id, dept_name, dept_phone, dept_ext)
    values ( dept_dept_id_seq.nextval, 'Software Engineering', 2122028259, 6821);

Insert into department( dept_id, dept_name, dept_phone, dept_ext)
    values ( dept_dept_id_seq.nextval, 'System' , 2122028259, 1926);

Insert into department( dept_id, dept_name, dept_phone, dept_ext)
    values ( dept_dept_id_seq.nextval, 'Network Systems', 2122028259, 4041);

Insert into department( dept_id, dept_name, dept_phone, dept_ext)
    values ( dept_dept_id_seq.nextval, 'Database Systems', 2122028259, 5080);

Insert into department( dept_id, dept_name, dept_phone, dept_ext)
    values ( dept_dept_id_seq.nextval, 'Project Management',2122028259, 8070);

Insert into department( dept_id, dept_name, dept_phone, dept_ext)
    values ( dept_dept_id_seq.nextval, 'Accounting and Finance' ,2122028259,9090);


/* end of the insert statement*/


/* update department to include department manager id */


update department
set dept_mgr_id = ( select emp_id from employee where emp_id = 35084)
where dept_id = (select emp_id from employee where emp_id = 400);


update department
set dept_mgr_id = ( select emp_id from employee where emp_id = 34174)
where dept_id = ( select dept_id from department where dept_id = 405);

update department
set dept_mgr_id = (select emp_id from employee where emp_id = 30534 )


                                                                                     18
where dept_id = ( select dept_id from department where dept_id = 410);


update department
set dept_mgr_id = select emp_id from employee where emp_id = 35734 )
where dept_id = ( select dept_id from department where dept_id = 415);

update department
set dept_mgr_id = (select emp_id from employee where emp_id = 33264)
where dept_id = (select dept_id from employee where dept_id = 420) ;

update department
set dept_mgr_id = (select emp_id from employee where emp_id = 35344 )
where dept_id = ( select emp_id from employee where emp_id 425);

update department
set dept_mgr_id = (select emp_id from employee where emp_id = 36124 )
where dept_id = ( select dept_id from department where dept_id = 430);

/*end*/


/* insert records into the job table */

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'C++/.Net Developer');

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Java Developer');
  commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Php/ Java Script Developer')
  commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'HTML/XHTML Developer')
   commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Python Developer')
   commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Database Analyst');
   commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Database Developer');
   commit;

                                                                         19
insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Data Modeler');
  commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'System Analyst'):
  commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Systems Engineer' );
  commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Systems Administrator');
  commit;

insert into job (job_code,description)
 values ( job_job_code_seq.nextval, 'Database       Administrator');
 commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Technical Writter');
  commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Project Manager'
  );
  commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Network Engineer'
  );
  commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Network Specialist'
  );
  commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Network Security Specialist'
  );
  commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Graphics Specialist'
  );
  commit;



                                                                       20
insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Payroll Specialist'
  );
  commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Inventory Specialist'
  );
  commit;

insert into job (job_code,description)
  values ( job_job_code_seq.nextval, 'Test Analyst'
  );
  commit;

insert into job (job_code,description)
 values ( job_job_code_seq.nextval, 'system Analyst'
 );
 commit;


/* end of the insert statement*/



/* inserts the records into the project table*/


Insert into project (proj_num, proj_mgr_id, proj_name,due_date)
    values (proj_proj_num_seq.nextval, (select emp_id from employee where emp_id =
35604), 'New York Ticket Corp Payment System',
          to_date ('09-sep-2010', 'dd-mon-yyyy')
          );

Insert into project (proj_num, proj_mgr_id, proj_name,due_date)
    values (proj_proj_num_seq.nextval,
          (select emp_id from employee where emp_id = 35604),
          'St Paul College Web System Development',
          to_date('02-feb-2011', 'dd-mon-yyyy'));

Insert into project (proj_num, proj_mgr_id, proj_name,due_date)
    values (proj_proj_num_seq.nextval,
          (select emp_id from employee where emp_id =35474
          ), 'Citizens Bank Databae Development',
          to_date('09-AUG-2012', 'dd-mon-yyyy'));

Insert into project (proj_num, proj_mgr_id, proj_name,due_date)
    values (proj_proj_num_seq.nextval,
          (select emp_id from employee where emp_id = 35344 ),
           'WBBMN Urban TV System Development',

                                                                                     21
to_date('27-Dec-2013', 'dd-mon-yyyy'));



/* end of sql */


/* inserts records into the employee table*/


/* system enginner employee*/


Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Sunny','McCook', emp_ssn_seq.nextval, 50,
 (select dept_id from department where dept_id =410),
 (select job_code from job where job_code = 70),
 TO_DATE('29-MAR-1978','DD-MON-YYYY '), 'Male'
 );

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Mariah', 'Johnson', emp_ssn_seq.nextval, 50,
 (select dept_id from department where dept_id =410),
 (select job_code from job where job_code = 70),
 TO_DATE('19-feb-1955','DD-MON-YYYY '), 'female'
 );

 Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'James', 'Imgram', emp_ssn_seq.nextval, 40,
 (select dept_id from department where dept_id =410),
 (select job_code from job where job_code = 70),
 TO_DATE( '20-jan-1950','DD-MON-YYYY '), 'male'
 );


/*end */



 /*system admin sql insert */

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Joel', 'Roland', emp_ssn_seq.nextval, 40,
 (select dept_id from department where dept_id =410),
 (select job_code from job where job_code = 75),
 TO_DATE( '20-dec-1950','DD-MON-YYYY '), 'male'

                                                                                          22
);


Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Susan', 'Noah', emp_ssn_seq.nextval, 40,
 (select dept_id from department where dept_id =410),
 (select job_code from job where job_code = 75),
 TO_DATE( '10-apr-1964','DD-MON-YYYY '), 'female'
 );


Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Peter', 'Wolf', emp_ssn_seq.nextval, 40,
 (select dept_id from department where dept_id =410),
 (select job_code from job where job_code = 75),
 TO_DATE( '15-sep-1955','DD-MON-YYYY '), 'male'
 );


Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender )
values (emp_emp_id_seq.nextval , 'Marxwall', 'Luther', emp_ssn_seq.nextval, 40,
 (select dept_id from department where dept_id =410),
 (select job_code from job where job_code = 75),
 TO_DATE( '15-jan-1952','DD-MON-YYYY '), 'male'
 );

/* end sql /


/*system analyst*/

  Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Fox','Christopher',
 emp_ssn_seq.nextval, 40,
  (select dept_id from department where dept_id =410),
  (select job_code from job where job_code = 130),
  TO_DATE( '19- july-1977','DD-MON-YYYY '), 'male'
  );

 Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Deng', 'Alian',
 emp_ssn_seq.nextval, 30,
  (select dept_id from department where dept_id =410),
  (select job_code from job where job_code = 130),
  TO_DATE( '04-jun-1988', 'DD-MON-YYYY '), 'male');

                                                                                           23
/*end*/


/*database admins*/

 Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Jessica', 'Andy', emp_ssn_seq.nextval, 40,
  (select dept_id from department where dept_id =420),
  (select job_code from job where job_code = 80),
  TO_DATE( '01-Aug-1962','DD-MON-YYYY '), 'female'
  );

 Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Shirly', 'Davis', emp_ssn_seq.nextval, 40,
 (select dept_id from department where dept_id =420),
 (select job_code from job where job_code = 80),
 TO_DATE( '18-Aug-1962','DD-MON-YYYY '), 'female'
 );


   Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id,
job_code, dob, gender)
values (emp_emp_id_seq.nextval , 'Mathew', 'Brain', emp_ssn_seq.nextval, 40,
 (select dept_id from department where dept_id =420),
 (select job_code from job where job_code = 80),
 TO_DATE( '14-Aug-1980','DD-MON-YYYY '), 'male'
 );

    Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id,
job_code, dob, gender)
values (emp_emp_id_seq.nextval , 'Tyron', 'Banks', emp_ssn_seq.nextval, 40,
 (select dept_id from department where dept_id =420),
 (select job_code from job where job_code = 80),
 TO_DATE( '18-sep-1983','DD-MON-YYYY '), 'male'
 );

 /*end /

 /* db developer*/

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Donna', 'Haris', emp_ssn_seq.nextval, 40,
 (select dept_id from department where dept_id =420),
 (select job_code from job where job_code = 60),
 TO_DATE( '12-oct-1982','DD-MON-YYYY '), 'female'

                                                                                          24
);

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Linda', 'Mark', emp_ssn_seq.nextval, 40,
 (select dept_id from department where dept_id =420),
 (select job_code from job where job_code = 60),
 TO_DATE( '12-jul-1982','DD-MON-YYYY '), 'female'
 );

 Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Ruth', 'Baker', emp_ssn_seq.nextval, 40,
 (select dept_id from department where dept_id =420),
 (select job_code from job where job_code = 60),
 TO_DATE( '19-mar-1975','DD-MON-YYYY '), 'female'
 );

   Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id,
job_code, dob, gender)
values (emp_emp_id_seq.nextval , 'Kevin', 'Kenneth', emp_ssn_seq.nextval, 40,
 (select dept_id from department where dept_id =420),
 (select job_code from job where job_code = 60),
 TO_DATE( '09-mar-1975','DD-MON-YYYY '), 'male'
 );

 /* db developer end * /



 /* database modeler employee */

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Isabella', 'Clinton'
, emp_ssn_seq.nextval, 40,
  (select dept_id from department where dept_id =420),
  (select job_code from job where job_code = 65),
  TO_DATE( '11-oct-1975','DD-MON-YYYY '), 'female'
  );

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Sanford', 'Brown'
, emp_ssn_seq.nextval, 50,
  (select dept_id from department where dept_id =420),
  (select job_code from job where job_code = 65),
  TO_DATE( '08-nov-1972','DD-MON-YYYY '), 'male'
  );



                                                                                          25
Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Vonda', 'Ikenna'
, emp_ssn_seq.nextval, 30,
  (select dept_id from department where dept_id =420),
  (select job_code from job where job_code = 65),
  TO_DATE( '06-jun-1985','DD-MON-YYYY '), 'female'
  );

  Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Celina', 'Tobi'
, emp_ssn_seq.nextval, 30,
  (select dept_id from department where dept_id =420),
  (select job_code from job where job_code = 65),
  TO_DATE( '16-mar-1986','DD-MON-YYYY '), 'female'
  );


 /* end of sql */


/* database analyst */

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Brenda', 'Bell'
, emp_ssn_seq.nextval, 30,
  (select dept_id from department where dept_id =420),
  (select job_code from job where job_code = 55),
  TO_DATE( '16-mar-1988','DD-MON-YYYY '), 'female'
  );

 Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Jaqueline', 'king'
, emp_ssn_seq.nextval, 50,
  (select dept_id from department where dept_id =420),
  (select job_code from job where job_code = 55),
  TO_DATE( '04-aug-1967','DD-MON-YYYY '), 'female'
  );

   Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Roland', 'king'
, emp_ssn_seq.nextval, 30,
  (select dept_id from department where dept_id =420),
  (select job_code from job where job_code = 55),
  TO_DATE( '04-jan-1987','DD-MON-YYYY '), 'male'

                                                                                            26
);

   Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id,
job_code, dob, gender)
values (emp_emp_id_seq.nextval , 'Michael', 'Stevens', emp_ssn_seq.nextval, 50,
 (select dept_id from department where dept_id =420),
 (select job_code from job where job_code = 55),
 TO_DATE( '25-dec-1974','DD-MON-YYYY '), 'male'
 );

 /*end of statement*/


/* java*/

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Carol', 'Washington'
, emp_ssn_seq.nextval, 50,
  (select dept_id from department where dept_id =405),
  (select job_code from job where job_code = 50),
  TO_DATE( '12-jul-1984','DD-MON-YYYY '), 'female'
  );

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Rebeca', 'Peterson',
 emp_ssn_seq.nextval, 30,
  (select dept_id from department where dept_id =405),
  (select job_code from job where job_code = 50),
  TO_DATE( '21-oct-1987','DD-MON-YYYY '), 'female'
  );

   Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id,
job_code, dob, gender)
values (emp_emp_id_seq.nextval , 'Cherri', 'Keys', emp_ssn_seq.nextval, 50,
 (select dept_id from department where dept_id =405),
 (select job_code from job where job_code = 50),
 TO_DATE( '25-apr-1983','DD-MON-YYYY '), 'female'
 );

 /*end of statement */

/*php/java scripts*/


Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Jerry','Springfield',
 emp_ssn_seq.nextval, 30,

                                                                                         27
(select dept_id from department where dept_id =405),
 (select job_code from job where job_code = 135),
 TO_DATE( '18-feb-1979
 ','DD-MON-YYYY '), 'male'
 );

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Carlos', 'Winworth', emp_ssn_seq.nextval, 50,
 (select dept_id from department where dept_id =405),
 (select job_code from job where job_code =135),
 TO_DATE( '28-dec-1958','DD-MON-YYYY '), 'male'
 );

/*end*/

/* c++ developer */


Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Patrick', 'law',
 emp_ssn_seq.nextval, 40,
  (select dept_id from department where dept_id =405),
  (select job_code from job where job_code = 45),
  TO_DATE( '20-feb-1962','DD-MON-YYYY '), 'male'
  );

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Jonas', 'lake'
,emp_ssn_seq.nextval, 50,
  (select dept_id from department where dept_id =405),
  (select job_code from job where job_code = 45),
  TO_DATE( '28-feb-1963','DD-MON-YYYY '), 'male'
  );

 /*end*/

/* HTRML/XHTML*/

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Addie', 'Jude',
 emp_ssn_seq.nextval, 50,
  (select dept_id from department where dept_id =405),
  (select job_code from job where job_code = 140),
  TO_DATE( '19-may-1973','DD-MON-YYYY '), 'female'
  );



                                                                                         28
Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Adams', 'Wade'
,emp_ssn_seq.nextval, 50,
  (select dept_id from department where dept_id =405),
  (select job_code from job where job_code = 140),
  TO_DATE( '20-sep-1975','DD-MON-YYYY '), 'male'
  );

 /*end*/

/* phython */


  Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Robert', 'Lopez',
 emp_ssn_seq.nextval, 50,
  (select dept_id from department where dept_id =405),
  (select job_code from job where job_code = 145),
  TO_DATE( '2-jan -1983','DD-MON-YYYY '), 'male'
  );

/*end*/

 /* technical writer*/

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Ray', 'Richmond',
 emp_ssn_seq.nextval, 50,
  (select dept_id from department where dept_id =400),
  (select job_code from job where job_code = 85),
  TO_DATE( '2-oct-1982','DD-MON-YYYY '), 'male'
  );

  Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Zack','Richmond',
 emp_ssn_seq.nextval, 50,
  (select dept_id from department where dept_id =400),
  (select job_code from job where job_code = 85),
  TO_DATE( '2-jan-1963','DD-MON-YYYY '), 'male'
  );

 Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Ashland', 'Kedzie',
 emp_ssn_seq.nextval, 50,
  (select dept_id from department where dept_id =400),

                                                                                           29
(select job_code from job where job_code = 85),
 TO_DATE( '06-jul-1969','DD-MON-YYYY '), 'female'
 );

/*end */


/*project manager*/

  Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Joel' , 'Jeremiah',
 emp_ssn_seq.nextval, 60,
  (select dept_id from department where dept_id =425),
  (select job_code from job where job_code = 90),
  TO_DATE( '20-oct-1958','DD-MON-YYYY '), 'male'
  );

  Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Zack','Isaiah',
 emp_ssn_seq.nextval, 50,
  (select dept_id from department where dept_id =425),
  (select job_code from job where job_code = 90),
  TO_DATE( '13-oct-1966','DD-MON-YYYY '), 'male'
  );

 Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Ashland', 'Macnell',
 emp_ssn_seq.nextval, 50,
  (select dept_id from department where dept_id =425),
  (select job_code from job where job_code = 90),
  TO_DATE( '06-jul-1969','DD-MON-YYYY '), 'female'
  );

/*end*/


/*network specialist*/

 Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Sam', 'Walteron',
 emp_ssn_seq.nextval,50,
  (select dept_id from department where dept_id =415),
  (select job_code from job where job_code = 95),
  TO_DATE( '14-apr-1951','DD-MON-YYYY '), 'male'
  );



                                                                                           30
Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Jacob', 'Henson',
 emp_ssn_seq.nextval, 40,
  (select dept_id from department where dept_id =415),
  (select job_code from job where job_code = 100),
  TO_DATE( '13-jan-1970','DD-MON-YYYY '), 'male'
  );

 Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Lee', 'Chin',
 emp_ssn_seq.nextval, 30,
  (select dept_id from department where dept_id =415),
  (select job_code from job where job_code = 105),
  TO_DATE( '09-sep-1984', 'DD-MON-YYYY '), 'male');

/*end*/


 /*accounting and fianace */

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Rose', 'Henson',
 emp_ssn_seq.nextval, 40,
  (select dept_id from department where dept_id =430),
  (select job_code from job where job_code = 115),
  TO_DATE( '13-jan-1970','DD-MON-YYYY '), 'female'
  );

 Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Jackie', 'Hopewell',
 emp_ssn_seq.nextval, 30,
  (select dept_id from department where dept_id =430),
  (select job_code from job where job_code = 120),
  TO_DATE( '09-sep-1984', 'DD-MON-YYYY '), 'female');

/*end*/


  /*test analyst*/

Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Derick', 'Charles',
 emp_ssn_seq.nextval, 40,
  (select dept_id from department where dept_id =400),
  (select job_code from job where job_code = 125),

                                                                                           31
TO_DATE( '25-july-1970','DD-MON-YYYY '), 'male'
 );

 Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code,
dob, gender)
values (emp_emp_id_seq.nextval , 'Lou', 'Shih',
 emp_ssn_seq.nextval, 30,
  (select dept_id from department where dept_id =400),
  (select job_code from job where job_code = 125),
  TO_DATE( '04-jun-1989', 'DD-MON-YYYY '), 'female');

/*end*/

/* insert records of employees associated with project */


/* projct 900 */


insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 1200
  , (select emp_id from employee where emp_id = 34434)
  , (select proj_num from project where proj_num = 900 ) );


 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 900
  , (select emp_id from employee where emp_id = 34304)
  , (select proj_num from project where proj_num = 900));


insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 900
  ,(select emp_id from employee where emp_id = 33914)
  , (select proj_num from project where proj_num = 900));


 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 900
  , (select emp_id from employee where emp_id = 33784)
  , (select proj_num from project where proj_num = 900));


 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 890

                                                                                          32
, (select emp_id from employee where emp_id = 34174 )
 , (select proj_num from project where proj_num = 900));


 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 890
  , (select emp_id from employee where emp_id =34564 )
  , (select proj_num from project where proj_num = 900));


 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 890
  , (select emp_id from employee where emp_id = 35084)
  , (select proj_num from project where proj_num = 900));

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 890
  , (select emp_id from employee where emp_id =34954)
  , (select proj_num from project where proj_num = 900));

 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 890
  , (select emp_id from employee where emp_id = 36514)
  , (select proj_num from project where proj_num = 900));


 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 989
  , (select emp_id from employee where emp_id = 36384)
  , (select proj_num from project where proj_num = 900));



 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 1000
  , (select emp_id from employee where emp_id = 30664 )
  , (select proj_num from project where proj_num = 900));


insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 400
  , (select emp_id from employee where emp_id = 30534 )
  , (select proj_num from project where proj_num = 900));

                                                                                         33
insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 980
  , (select emp_id from employee where emp_id = 31054)
  , (select proj_num from project where proj_num = 900));


insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 800
  , (select emp_id from employee where emp_id = 31314 )
  , (select proj_num from project where proj_num = 900));


 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 690
  , (select emp_id from employee where emp_id = 33394 )
  , (select proj_num from project where proj_num = 900));

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 550
  , (select emp_id from employee where emp_id = 33264 )
  , (select proj_num from project where proj_num = 900));

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun-2008', 'dd-mon-yyyy'), 1200,
    (select emp_id from employee where emp_id = 32224)
  , (select proj_num from project where proj_num = 900));

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun-2008', 'dd-mon-yyyy'), 980,
    (select emp_id from employee where emp_id = 32094)
  , (select proj_num from project where proj_num = 900));

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 550
  , (select emp_id from employee where emp_id = 32874 )
  , (select proj_num from project where proj_num = 900));

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun-2008', 'dd-mon-yyyy'), 1200,

                                                                                         34
(select emp_id from employee where emp_id = 31704 )
 , (select proj_num from project where proj_num = 900));

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun-2008', 'dd-mon-yyyy'), 980,
    (select emp_id from employee where emp_id = 35994)
  , (select proj_num from project where proj_num = 900));


insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun-2008', 'dd-mon-yyyy'), 1200,
    (select emp_id from employee where emp_id = 36124 )
  , (select proj_num from project where proj_num = 900));

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-jun-2008', 'dd-mon-yyyy'), 980,
    (select emp_id from employee where emp_id = 36254 )
  , (select proj_num from project where proj_num = 900));


 /* project num 905 */

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 980
  , (select emp_id from employee where emp_id = 35214)
  , (select proj_num from project where proj_num = 905));

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 780
  , (select emp_id from employee where emp_id = 36384)
  , (select proj_num from project where proj_num = 905));

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 890
  , (select emp_id from employee where emp_id = 34824)
  , (select proj_num from project where proj_num = 905));

 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 400
  , (select emp_id from employee where emp_id = 34044)
  , (select proj_num from project where proj_num = 55));




                                                                                         35
insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 400,
    (select emp_id from employee where emp_id = 34174)
  , (select proj_num from project where proj_num = 905));


insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 500,
    (select emp_id from employee where emp_id = 34434)
  , (select proj_num from project where proj_num = 905));


 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 800,
    (select emp_id from employee where emp_id = 34304)
  , (select proj_num from project where proj_num = 905));


  insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 789,
    (select emp_id from employee where emp_id = 33784 )
  , (select proj_num from project where proj_num = 905));


 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 789,
    (select emp_id from employee where emp_id = 32224 )
  , (select proj_num from project where proj_num = 905));


   insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 890,
    (select emp_id from employee where emp_id = 32484)
  , (select proj_num from project where proj_num = 905));


 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 900,
    (select emp_id from employee where emp_id = 32744)
  , (select proj_num from project where proj_num = 905));




                                                                                        36
insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 989,
    (select emp_id from employee where emp_id = 30404)
  , (select proj_num from project where proj_num = 905));

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'),900,
    (select emp_id from employee where emp_id = 30924 )
  , (select proj_num from project where proj_num = 905));


insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 1500,
    (select emp_id from employee where emp_id = 31834)
  , (select proj_num from project where proj_num = 905));

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 1400,
    (select emp_id from employee where emp_id = 31444)
  , (select proj_num from project where proj_num = 905));

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 699,
    (select emp_id from employee where emp_id = 35994)
  , (select proj_num from project where proj_num = 905));

  insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 850,
    (select emp_id from employee where emp_id = 35864)
  , (select proj_num from project where proj_num = 905));


insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 90,
    (select emp_id from employee where emp_id = 36124)
  , (select proj_num from project where proj_num = 905));

  insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 850,
    (select emp_id from employee where emp_id = 36254)
  , (select proj_num from project where proj_num = 905));



                                                                                         37
insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 850,
    (select emp_id from employee where emp_id = 33134)
  , (select proj_num from project where proj_num = 905));

/*end of project 905 */


/* project 910 */


 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 1800,
    (select emp_id from employee where emp_id = 33654 )
  , (select proj_num from project where proj_num = 910));

 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 1200,
    (select emp_id from employee where emp_id = 33524 )
  , (select proj_num from project where proj_num = 910));

 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 1340,
    (select emp_id from employee where emp_id = 32354)
  , (select proj_num from project where proj_num = 910));

    insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 980,
    (select emp_id from employee where emp_id = 33004)
  , (select proj_num from project where proj_num = 910));

    insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 1050,
    (select emp_id from employee where emp_id = 32614 )
  , (select proj_num from project where proj_num = 910));

      insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours,
emp_id, proj_num)
 values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 1300,
   (select emp_id from employee where emp_id = 31184 )
 , (select proj_num from project where proj_num = 910));

  insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)

                                                                                         38
values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 290,
   (select emp_id from employee where emp_id = 30794)
 , (select proj_num from project where proj_num = 910));

  insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 800,
    (select emp_id from employee where emp_id = 31964 )
  , (select proj_num from project where proj_num = 910));


insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 780,
    (select emp_id from employee where emp_id = 31574)
  , (select proj_num from project where proj_num = 910));


 insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('27-dec-2010', 'dd-mon-yyyy'), 550,
    (select emp_id from employee where emp_id = 34694 )
  , (select proj_num from project where proj_num = 910));


insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('27-dec-2010', 'dd-mon-yyyy'), 650,
    (select emp_id from employee where emp_id = 35734 )
  , (select proj_num from project where proj_num = 910));


insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('27-dec-2010', 'dd-mon-yyyy'), 890,
    (select emp_id from employee where emp_id = 34434 )
  , (select proj_num from project where proj_num = 910));


insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('27-dec-2010', 'dd-mon-yyyy'), 900,
    (select emp_id from employee where emp_id = 32224 )
  , (select proj_num from project where proj_num = 910));

insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('27-dec-2010', 'dd-mon-yyyy'), 900,
    (select emp_id from employee where emp_id = 30404)
  , (select proj_num from project where proj_num = 910));

                                                                                        39
insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('27-dec-2010', 'dd-mon-yyyy'), 1200,
    (select emp_id from employee where emp_id = 31834 )
  , (select proj_num from project where proj_num = 910));


insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id,
proj_num)
  values ( assign_assign_num_seq.nextval, to_date('27-dec-2010', 'dd-mon-yyyy'), 550,
    (select emp_id from employee where emp_id = 34174)
  , (select proj_num from project where proj_num = 910));


 /* update assign hours*/

 update assignment
set assign_hours = 1200
where ASSIGNMENT_NUM = 5824
/*end sql*/




/*end*/

/* updates the cost for each employee based on their pay rate */


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num =5296 )
where emp_id = 35214
and Assignment_Num =5296 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num =5308 )
where emp_id = 36384
and Assignment_Num =5308 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num =5320)
where emp_id = 34824
and Assignment_Num =5320 ;




                                                                                         40
update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num =5344 )
where emp_id = 34174
and Assignment_Num =5344 ;


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num =5356 )
where emp_id = 34434
and Assignment_Num =5356 ;


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num =5368)
where emp_id = 34044
and Assignment_Num =5368 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num =5380)
where emp_id =33784
and Assignment_Num = 5380;


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num =5392)
where emp_id = 34304
and Assignment_Num =5392 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num =5404)
where emp_id = 32224
and Assignment_Num =5404 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num =5416)
where emp_id = 32484
and Assignment_Num =5416 ;


 update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5428)
where emp_id = 32744

                                                                                         41
and Assignment_Num = 5428 ;


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5440)
where emp_id = 30404
and Assignment_Num = 5440 ;


 update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5452)
where emp_id = 30924
and Assignment_Num = 5452 ;

 update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5464)
where emp_id = 31834
and Assignment_Num = 5464;


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5488)
where emp_id = 35994
and Assignment_Num = 5488;



update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5500)
where emp_id = 35864
and Assignment_Num = 5500;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5476 )
where emp_id = 31444
and Assignment_Num = 5476;


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5512 )
where emp_id = 36124
and Assignment_Num = 5512;



                                                                                         42
update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5524 )
where emp_id = 36254
and Assignment_Num = 5524 ;


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5536 )
where emp_id = 33134
and Assignment_Num = 5536;


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5188 )
where emp_id = 33394
and Assignment_Num = 5188;

 update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5200 )
where emp_id = 33264
and Assignment_Num = 5200;


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5212)
where emp_id = 32224
and Assignment_Num = 5212;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5224 )
where emp_id = 32094
and Assignment_Num = 5224 ;

 update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5236 )
where emp_id = 32874
and Assignment_Num = 5236;


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5248 )
where emp_id = 31704

                                                                                         43
and Assignment_Num = 5248;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5260 )
where emp_id = 35994
and Assignment_Num = 5260 ;

 update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5272)
where emp_id = 36124
and Assignment_Num = 5272;


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5020)
where emp_id = 34434
and Assignment_Num = 5020;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5032 )
where emp_id = 34304
and Assignment_Num = 5032 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5044 )
where emp_id = 33914
and Assignment_Num = 5044 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5056 )
where emp_id = 33784
and Assignment_Num = 5056 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5068 )
where emp_id = 34174
and Assignment_Num = 5068;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5080)
where emp_id = 34564
and Assignment_Num = 5080 ;

                                                                                         44
update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5092 )
where emp_id = 35084
and Assignment_Num = 5092;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5104 )
where emp_id = 34954
and Assignment_Num = 5104 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5116 )
where emp_id = 36514
and Assignment_Num = 5116;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5128 )
where emp_id = 36384
and Assignment_Num = 5128 ;

 update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5140 )
where emp_id = 30664
and Assignment_Num = 5140 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5152)
where emp_id = 30534
and Assignment_Num = 5152;


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5164 )
where emp_id = 31054
and Assignment_Num = 5164 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5176 )
where emp_id = 31314
and Assignment_Num = 5176;



                                                                                         45
update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 91608)
where emp_id = 36254
and Assignment_Num = 91608;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5284 )
where emp_id = 36254
and Assignment_Num = 5284 ;


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5608 )
where emp_id = 33654
and Assignment_Num = 5608;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5620 )
where emp_id = 33524
and Assignment_Num = 5620;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5632)
where emp_id = 32354
and Assignment_Num = 5632 ;


update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5644 )
where emp_id = 33004
and Assignment_Num = 5644 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5656)
where emp_id = 31184
and Assignment_Num = 5656;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5680 )
where emp_id = 30794
and Assignment_Num = 5680;



                                                                                         46
update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5668)
where emp_id = 32614
and Assignment_Num = 5668 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5692 )
where emp_id = 31964
and Assignment_Num = 5692 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5704 )
where emp_id = 31574
and Assignment_Num = 5704 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5740 )
where emp_id = 34694
and Assignment_Num = 5740;

 update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5752)
where emp_id = 35734
and Assignment_Num = 5752 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5764 )
where emp_id = 34434
and Assignment_Num = 5764 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5776 )
where emp_id = 32224
and Assignment_Num = 5776;


 update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5788 )
where emp_id = 30404
and Assignment_Num = 5788 ;

update assignment

                                                                                         47
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5812 )
where emp_id = 31834
and Assignment_Num = 5812 ;

update assignment
set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a
on e.emp_id = a.emp_id where a.Assignment_Num = 5824)
where emp_id = 34174
and Assignment_Num = 5824;



/*end*/



/* inserts the record for employee contact information */


insert into contact (contact_id, emp_id, address, city, h_state, phone_home, phone_work,
email_office)
 values (con_contact_id_seq.nextval,
   ( select emp_id from employee where emp_id = 35474), '8080 W Maddison', 'City
Heights', 'NJ', 2029091840, 82500920, 'ray.rich@sunlife.com');

 insert into contact (contact_id, emp_id, address, city, h_state, phone_home, phone_work,
email_office)
  values (con_contact_id_seq.nextval,
   ( select emp_id from employee where emp_id = 30794), '909 E Hudson', 'New York
City', 'NY', 2098908860, 82500922, 'zach.rich@sunlife.com') ;

insert into contact (contact_id, emp_id, address, apt_num, city, h_state, phone_home,
phone_work, email_office)
 values (con_contact_id_seq.nextval,
   ( select emp_id from employee where emp_id = 34434), '4040 E Fifth Ave', '18GC',
'New York City', 'NY', 2013499292, 82500924, 'ashland.kediz@sunlife.com');

insert into contact (contact_id, emp_id, address, apt_num, city, h_state, phone_home,
phone_work, email_office)
 values (con_contact_id_seq.nextval,
   ( select emp_id from employee where emp_id = 30404), '1900 S Lake Pine Dr', '2d',
'New England', 'CT', 2420017540, 82500923, 'derick.charl@sunlife.com');

insert into contact (contact_id, emp_id, address, apt_num, city, h_state, phone_home,
phone_work, email_office)
 values (con_contact_id_seq.nextval,
   ( select emp_id from employee where emp_id = 34174), '1200 S brodway Dr', '4c',
'New bedford Park', 'CT', 2123988019, 82500926, 'lou.shi@sunlife.com');



                                                                                            48
Database Snappshot




The log file could not be captured with a web browser. The following captured pictures
reprsents the database state.
Figure 1 described issued command describes table structure for Department, Project and
Employee. The describe isssued command in figure 2 describes the table structures for
Job, Contact and Assiignment.




                                                                                          49
Figure 1 Table Structures




                            50
Figure 2 Table Structure




                           51
Figure 3 Contact Table Data




                              52
Figure 4 Department Table Data




                                 53
Figure 5 Project Table Data




                              54
Figure 6 Employee Table Data




                               55
Figure 7 Employee Table Data




                               56
Figure 8 Assignment Table Data




                                 57
Figure 9 Assignment Table Data




                                 58
Figure 10 Assignment Table Data




                                  59
Figure 11 Job Table Data




                           60
61
Deliverable 5 - SQL Queries


/* Show me name of employess whose job code is 65 */

SELECT first_name, last_name, job_code
from employee
where job_code= '65';




        First_Name             Last_Name              Job_Code
         Sanford                Brown                     65
          Vonda                 Ikenna                    65
          Celina                 Tobi                     65
         Isabella               Clinton                   65

                                        Table 8


/* Show me the total number of employess for different job codes */


SELECT job_code, count (*) as Total_number
from employee
Group by job_code;


               JOB_CODE                                 TOTAL_NUMBER
                  115                                         1
                  125                                         2
                   70                                         3
                  135                                         2
                  105                                         1
                   60                                         4
                   50                                         3
                   45                                         2
                  145                                         1
                  140                                         2
                   85                                         3
                  130                                         2
                   65                                         4
                   55                                         4


                                                                       62
95                                            1
                    90                                            3
                   100                                            1
                   120                                            1
                    75                                            4
                    80                                            4


                                   Table 9


/* Show me the lowest rate for job code 65 */

select min(emp_rate) "Lowest Rate"
from employee
where job_code= '65'
group by job_code;



Lowest Rate
                                                                                       30
                                       Table 10




/* Show me the name of employees with highest rate . List them by their first name*/

select first_name , last_name, emp_rate AS Lowest_emp_rate
from employee
where
emp_rate =
(select min(emp_rate)
from employee )
order by first_name;



FIRST_NAME           LAST_NAME               LOWEST_EMP_RATE
     Brenda                Bell                     30
     Celina                Tobi                     30
      Deng                Alian                     30
     Jackie              Hopewell                   30
      Jerry             Springfield                 30
       Lee                 Chin                     30


                                                                                            63
Lou                   Shih                     30


                              Table 11




/* subquery, Show the list of employees whose emp rate is greater than average rate */


select initcap(first_name) as FIRST_NAME, initcap (last_name) as LAST_NAME,
initcap(gender) as GENDER, emp_rate
from employee
where emp_rate > ( select avg(emp_rate) from employee);

FIRST_NAME             LAST_NAME             GENDER           EMP_RATE
     Sanford                Brown               Male               50
    Jaqueline                King              Female              50
     Michael               Stevens              Male               50
      Carol              Washington            Female              50
      Cherri                 Keys              Female              50
      Carlos              Winworth              Male               50
      Jonas                  Lake               Male               50
      Addie                  Jude              Female              50
     Adams                  Wade                Male               50
     Robert                 Lopez               Male               50
       Ray                Richmond              Male               50
       Zack               Richmond              Male               50
     Ashland                Kedzie             Female              50
       Joel               Jeremiah              Male               60
       Zack                 Isaiah              Male               50
     Ashland               Macnell             Female              50
       Sam                Walteron              Male               50
      Sunny                Mccook               Male               50
     Mariah                Johnson             Female              50

                                 Table 12




                                                                                         64
/* Show the list of the employees who are working on the project assigned in the past 6
months */



Select e.first_name,e.last_name , a.assign_date, assignment_num
from employee e, assignment a
where
e.emp_id=a.emp_id
and
assign_date > (add_months(sysdate, -6))

FIRST_NAME           LAST_NAME             ASSIGN_DATE            ASSIGNMENT_NUM
     Joel                Roland               01-FEB-11                 5680
    Marxwall                Luther             01-FEB-11                   5656
      Jessica               Andy               01-FEB-11                   5704
      Tyron                 Banks              01-FEB-11                   5692
       Ruth                 Baker              01-FEB-11                   5632
     Isabella              Clinton             01-FEB-11                   5668
      Celina                 Tobi              01-FEB-11                   5644


                                        Table 13


/* Joining Three Tables.Show the name of employee , their ID, and project description
whose projects are overdue today */



select emp_id, e.first_name, proj_name, p.due_date
from employee e JOIN assignment a
using(emp_id)
JOIN
project p
using (proj_num)
where
due_date< sysdate




                                                                                          65
EMP_ID   FIRST_NAME          PROJ_NAME              DUE_DATE    EMP_ID

 32744     Sanford     St Paul College Web System   02-FEB-11    32744
                             Development
 32874      Vonda        New York Ticket Corp       09-SEP-10    32874
                            Payment System
 33134      Brenda     St Paul College Web System   02-FEB-11    33134
                             Development
 33264     Jaqueline     New York Ticket Corp       09-SEP-10    33264
                            Payment System
 33394      Roland       New York Ticket Corp       09-SEP-10    33394
                            Payment System
 33784     Rebeca      St Paul College Web System   02-FEB-11    33784
                             Development
 33784     Rebeca        New York Ticket Corp       09-SEP-10    33784
                            Payment System
 33914      Cherri       New York Ticket Corp       09-SEP-10    33914
                            Payment System
 34044       Jerry     St Paul College Web System   02-FEB-11    34044
                             Development
 34174      Carlos     St Paul College Web System   02-FEB-11    34174
                             Development
 34174      Carlos       New York Ticket Corp       09-SEP-10    34174
                            Payment System
 34304      Patrick    St Paul College Web System   02-FEB-11    34304
                             Development
 34304      Patrick      New York Ticket Corp       09-SEP-10    34304
                            Payment System
 34434      Jonas      St Paul College Web System   02-FEB-11    34434
                             Development
 34434      Jonas        New York Ticket Corp       09-SEP-10    34434



                                                                         66
Payment System
34564   Addie       New York Ticket Corp       09-SEP-10   34564
                       Payment System
34824   Robert    St Paul College Web System   02-FEB-11   34824
                        Development
34954    Ray        New York Ticket Corp       09-SEP-10   34954
                       Payment System
35084    Zack       New York Ticket Corp       09-SEP-10   35084
                       Payment System
35214   Ashland   St Paul College Web System   02-FEB-11   35214
                        Development
35864    Jacob    St Paul College Web System   02-FEB-11   35864
                        Development
35994    Lee      St Paul College Web System   02-FEB-11   35994
                        Development
35994    Lee        New York Ticket Corp       09-SEP-10   35994
                       Payment System
36124    Rose     St Paul College Web System   02-FEB-11   36124
                        Development
36124    Rose       New York Ticket Corp       09-SEP-10   36124
                       Payment System
36254   Jackie    St Paul College Web System   02-FEB-11   36254
                        Development
36254   Jackie      New York Ticket Corp       09-SEP-10   36254
                       Payment System
36384   Derick    St Paul College Web System   02-FEB-11   36384
                        Development
36384   Derick      New York Ticket Corp       09-SEP-10   36384
                       Payment System
30404   Sunny     St Paul College Web System   02-FEB-11   30404
                        Development
30534   Mariah      New York Ticket Corp       09-SEP-10   30534
                       Payment System


                                                                   67
30664   James      New York Ticket Corp       09-SEP-10   30664
                      Payment System
30924   Susan    St Paul College Web System   02-FEB-11   30924
                       Development
31054    Peter     New York Ticket Corp       09-SEP-10   31054
                      Payment System
31314    Fox       New York Ticket Corp       09-SEP-10   31314
                      Payment System
31444    Deng    St Paul College Web System   02-FEB-11   31444
                       Development
31704   Shirly     New York Ticket Corp       09-SEP-10   31704
                      Payment System
31834   Mathew   St Paul College Web System   02-FEB-11   31834
                       Development
32094   Donna      New York Ticket Corp       09-SEP-10   32094
                      Payment System
32224   Linda    St Paul College Web System   02-FEB-11   32224
                       Development
32224   Linda      New York Ticket Corp       09-SEP-10   32224
                      Payment System
32484   Kevin    St Paul College Web System   02-FEB-11   32484
                       Development
36514    Lou       New York Ticket Corp       09-SEP-10   36514
                      Payment System




                         Table 14




                                                                  68
Deliverable 6 -Database Maintenance Scripts

/* create the dependent table*/

CREATE TABLE DEPENDENT
  (
   Depend_Num Number (5),
   First_Name VARCHAR2(50),
   Last_Name VARCHAR2(50),
    Dep_Dob DATE ,
   Emp_id NUMBER,
        Depend_Type varchar2(20)
 );

 /* create the sequence for the primary key for depend_num*/

create sequence depend_depend_num_seq
start with 065000
increment by 13
Nocycle;

/* creates the constraints assiocated with dependent table */

 Alter table DEPENDENT
  modify (first_name CONSTRAINT depend_first_name_nn not null)
        modify (last_name CONSTRAINT depend_last_name_nn not null)
        modify (dep_DOB CONSTRAINT depend_dep_dob_mn not null )
  modify (emp_id CONSTRAINT depend_Emp_id_nn NOT NULL)
        modify (Depend_Type CONSTRAINT depend_Depend_Type_nn NOT
NULL);


 Alter table DEPENDENT
   add constraint depend_Depend_num_pk PRIMARY KEY (Depend_Num);

Alter table DEPENDENT
  add CONSTRAINT Depend_Emp_id_fk FOREIGN KEY(Emp_id) REFERENCES
EMPLOYEE(Emp_id);




                                                                     69
DML Statements


insert into dependent (depend_num, first_name, last_name, dep_dob, emp_id,
Depend_Type )
       values ( depend_depend_num_seq.nextval, 'Nancy', 'Brown', to_date('18-oct-1969',
'dd-mon-yyyy'),
                       (select emp.emp_id from employee emp where emp.emp_id =
32744),
                                 'Wife'
                      );

insert into dependent (depend_num, first_name, last_name, dep_dob, emp_id,
Depend_Type )
       values ( depend_depend_num_seq.nextval, 'John', 'Ikenna', to_date('08-dec-1985',
'dd-mon-yyyy'),
                       (select emp.emp_id from employee emp where emp.emp_id =
32874),
                                 'Husband'
                      );

insert into dependent (depend_num, first_name, last_name, dep_dob, emp_id,
Depend_Type )
       values ( depend_depend_num_seq.nextval, 'Greg', 'Tobi', to_date('12-mar-1985',
'dd-mon-yyyy'),
                       (select emp.emp_id from employee emp where emp.emp_id =
33004),
                                 'Partner'
                      );
insert into dependent (depend_num, first_name, last_name, dep_dob, emp_id,
Depend_Type )
       values ( depend_depend_num_seq.nextval, 'Mariah', 'Winfield', to_date('09-apr-
1969', 'dd-mon-yyyy'),
                       (select emp.emp_id from employee emp where emp.emp_id =
33134),
                                 'Partner'
                      );

insert into dependent (depend_num, first_name, last_name, dep_dob, emp_id,
Depend_Type )
       values ( depend_depend_num_seq.nextval, 'luther', 'king', to_date('09-apr-1988',
'dd-mon-yyyy'),
                       (select emp.emp_id from employee emp where emp.emp_id =
33394),
                                 'Partner'
                      );


                                                                                          70
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project
Object Relational  Database Project

More Related Content

What's hot

Database Design
Database DesignDatabase Design
Database Designlearnt
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
Mudasir Qazi
 
What is a DATA DICTIONARY?
What is a DATA DICTIONARY?What is a DATA DICTIONARY?
What is a DATA DICTIONARY?
Leela Vasundara D K
 
Software architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding GuideSoftware architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding Guide
Mohammed Fazuluddin
 
03 Ch3 Notes Revised
03 Ch3 Notes Revised03 Ch3 Notes Revised
03 Ch3 Notes Revised
guest6f408c
 
The virtual DOM and how react uses it internally
The virtual DOM and how react uses it internallyThe virtual DOM and how react uses it internally
The virtual DOM and how react uses it internally
Clóvis Neto
 
Peoplesoft PIA architecture
Peoplesoft PIA architecturePeoplesoft PIA architecture
Peoplesoft PIA architectureAmit rai Raaz
 
Hidden Camera 3 APIs in Android 4.4 (KitKat)
Hidden Camera 3 APIs in Android 4.4 (KitKat)Hidden Camera 3 APIs in Android 4.4 (KitKat)
Hidden Camera 3 APIs in Android 4.4 (KitKat)
Balwinder Kaur
 
Components of client server application
Components of client server applicationComponents of client server application
Components of client server application
Ashwin Ananthapadmanabhan
 
Proper Use Of Modifier 59
Proper Use Of Modifier 59Proper Use Of Modifier 59
Proper Use Of Modifier 59Karna *
 
Main Components Of Database Management Systems.pptx
Main Components Of Database Management Systems.pptxMain Components Of Database Management Systems.pptx
Main Components Of Database Management Systems.pptx
Green University of Bangladesh
 
Requirements documentation standards ieee830
Requirements documentation standards   ieee830Requirements documentation standards   ieee830
Requirements documentation standards ieee830Abdul Basit
 
Dbms Concepts
Dbms ConceptsDbms Concepts
Dbms Conceptsadukkas
 

What's hot (13)

Database Design
Database DesignDatabase Design
Database Design
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
 
What is a DATA DICTIONARY?
What is a DATA DICTIONARY?What is a DATA DICTIONARY?
What is a DATA DICTIONARY?
 
Software architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding GuideSoftware architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding Guide
 
03 Ch3 Notes Revised
03 Ch3 Notes Revised03 Ch3 Notes Revised
03 Ch3 Notes Revised
 
The virtual DOM and how react uses it internally
The virtual DOM and how react uses it internallyThe virtual DOM and how react uses it internally
The virtual DOM and how react uses it internally
 
Peoplesoft PIA architecture
Peoplesoft PIA architecturePeoplesoft PIA architecture
Peoplesoft PIA architecture
 
Hidden Camera 3 APIs in Android 4.4 (KitKat)
Hidden Camera 3 APIs in Android 4.4 (KitKat)Hidden Camera 3 APIs in Android 4.4 (KitKat)
Hidden Camera 3 APIs in Android 4.4 (KitKat)
 
Components of client server application
Components of client server applicationComponents of client server application
Components of client server application
 
Proper Use Of Modifier 59
Proper Use Of Modifier 59Proper Use Of Modifier 59
Proper Use Of Modifier 59
 
Main Components Of Database Management Systems.pptx
Main Components Of Database Management Systems.pptxMain Components Of Database Management Systems.pptx
Main Components Of Database Management Systems.pptx
 
Requirements documentation standards ieee830
Requirements documentation standards   ieee830Requirements documentation standards   ieee830
Requirements documentation standards ieee830
 
Dbms Concepts
Dbms ConceptsDbms Concepts
Dbms Concepts
 

Viewers also liked

Exhibition Strategies Presentation
Exhibition Strategies PresentationExhibition Strategies Presentation
Exhibition Strategies Presentation
Chris Ubik
 
Sheridan Taylor Portfolio 2016.
Sheridan Taylor Portfolio 2016.Sheridan Taylor Portfolio 2016.
Sheridan Taylor Portfolio 2016.Sheridan Taylor
 
Mirna Senior Project 2 Report
Mirna Senior Project 2 ReportMirna Senior Project 2 Report
Mirna Senior Project 2 ReportGalala University
 
Presentation1
Presentation1Presentation1
Presentation1
Mohab Amr
 
International Project Management Environments
International Project Management EnvironmentsInternational Project Management Environments
International Project Management Environments
David Prat
 
Project stake holder analysis and cultural influence on international project...
Project stake holder analysis and cultural influence on international project...Project stake holder analysis and cultural influence on international project...
Project stake holder analysis and cultural influence on international project...
NICHOLAS PAUL
 
Professor Lourdes Guàrdia, How to evaluate generic Competences using Web 2.0:...
Professor Lourdes Guàrdia, How to evaluate generic Competences using Web 2.0:...Professor Lourdes Guàrdia, How to evaluate generic Competences using Web 2.0:...
Professor Lourdes Guàrdia, How to evaluate generic Competences using Web 2.0:...
mediazoo
 
The Anchor: Sports with Household Appliances
The Anchor: Sports with Household AppliancesThe Anchor: Sports with Household Appliances
The Anchor: Sports with Household AppliancesAnni Rautio
 
Business communication final
Business communication finalBusiness communication final
Business communication finalJaffar Hussain
 
V.Bisters prezentacija
V.Bisters prezentacijaV.Bisters prezentacija
V.Bisters prezentacijaconsumerenergy
 
Косых В.Н. Социальные медиа VS традиционные коммуникации в PR
Косых В.Н. Социальные медиа VS традиционные коммуникации в PRКосых В.Н. Социальные медиа VS традиционные коммуникации в PR
Косых В.Н. Социальные медиа VS традиционные коммуникации в PR
prasu1995
 
Quatrepetitescantonades grup 1 DRIADES
Quatrepetitescantonades grup 1 DRIADESQuatrepetitescantonades grup 1 DRIADES
Quatrepetitescantonades grup 1 DRIADESparvularielsagrer
 
Visual resume Igor
Visual resume IgorVisual resume Igor
Visual resume Igor
Igor Marin
 
Formulario clientes
Formulario clientesFormulario clientes
Formulario clienteskode99
 
Moyano mónica the wine marking process
Moyano mónica the wine marking processMoyano mónica the wine marking process
Moyano mónica the wine marking processMonica Moyano
 
Algumas curiosidades e cases web 2.0
Algumas curiosidades e cases web 2.0Algumas curiosidades e cases web 2.0
Algumas curiosidades e cases web 2.0
Consultor em Marketing Digital para pequenas empresas
 

Viewers also liked (20)

Exhibition Strategies Presentation
Exhibition Strategies PresentationExhibition Strategies Presentation
Exhibition Strategies Presentation
 
BikeOrderProcessV2
BikeOrderProcessV2BikeOrderProcessV2
BikeOrderProcessV2
 
Sheridan Taylor Portfolio 2016.
Sheridan Taylor Portfolio 2016.Sheridan Taylor Portfolio 2016.
Sheridan Taylor Portfolio 2016.
 
Mirna Senior Project 2 Report
Mirna Senior Project 2 ReportMirna Senior Project 2 Report
Mirna Senior Project 2 Report
 
Presentation1
Presentation1Presentation1
Presentation1
 
International Project Management Environments
International Project Management EnvironmentsInternational Project Management Environments
International Project Management Environments
 
Project stake holder analysis and cultural influence on international project...
Project stake holder analysis and cultural influence on international project...Project stake holder analysis and cultural influence on international project...
Project stake holder analysis and cultural influence on international project...
 
Mughal Empire
Mughal EmpireMughal Empire
Mughal Empire
 
Professor Lourdes Guàrdia, How to evaluate generic Competences using Web 2.0:...
Professor Lourdes Guàrdia, How to evaluate generic Competences using Web 2.0:...Professor Lourdes Guàrdia, How to evaluate generic Competences using Web 2.0:...
Professor Lourdes Guàrdia, How to evaluate generic Competences using Web 2.0:...
 
5 penyebaran data
5 penyebaran data5 penyebaran data
5 penyebaran data
 
The Anchor: Sports with Household Appliances
The Anchor: Sports with Household AppliancesThe Anchor: Sports with Household Appliances
The Anchor: Sports with Household Appliances
 
Business communication final
Business communication finalBusiness communication final
Business communication final
 
V.Bisters prezentacija
V.Bisters prezentacijaV.Bisters prezentacija
V.Bisters prezentacija
 
Косых В.Н. Социальные медиа VS традиционные коммуникации в PR
Косых В.Н. Социальные медиа VS традиционные коммуникации в PRКосых В.Н. Социальные медиа VS традиционные коммуникации в PR
Косых В.Н. Социальные медиа VS традиционные коммуникации в PR
 
Quatrepetitescantonades grup 1 DRIADES
Quatrepetitescantonades grup 1 DRIADESQuatrepetitescantonades grup 1 DRIADES
Quatrepetitescantonades grup 1 DRIADES
 
Visual resume Igor
Visual resume IgorVisual resume Igor
Visual resume Igor
 
Formulario clientes
Formulario clientesFormulario clientes
Formulario clientes
 
екстернат
екстернатекстернат
екстернат
 
Moyano mónica the wine marking process
Moyano mónica the wine marking processMoyano mónica the wine marking process
Moyano mónica the wine marking process
 
Algumas curiosidades e cases web 2.0
Algumas curiosidades e cases web 2.0Algumas curiosidades e cases web 2.0
Algumas curiosidades e cases web 2.0
 

Similar to Object Relational Database Project

IMS504/IMS506
IMS504/IMS506IMS504/IMS506
IMS504/IMS506UiTM
 
Possible Algorithms of 2NF and 3NF for DBNorma- A tool for Relational Databas...
Possible Algorithms of 2NF and 3NF for DBNorma- A tool for Relational Databas...Possible Algorithms of 2NF and 3NF for DBNorma- A tool for Relational Databas...
Possible Algorithms of 2NF and 3NF for DBNorma- A tool for Relational Databas...
IDES Editor
 
Peoplesoft Basic App designer
Peoplesoft Basic App designerPeoplesoft Basic App designer
Peoplesoft Basic App designermbtechnosolutions
 
HA Hadoop -ApacheCon talk
HA Hadoop -ApacheCon talkHA Hadoop -ApacheCon talk
HA Hadoop -ApacheCon talkSteve Loughran
 
Mydb 2010 - AbhijeetKalsi
Mydb 2010 - AbhijeetKalsiMydb 2010 - AbhijeetKalsi
Mydb 2010 - AbhijeetKalsi
Abhijeet Kalsi
 
iFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature ImplementationsiFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature Implementations
Shinpei Hayashi
 
Resume ratna rao updated
Resume ratna rao updatedResume ratna rao updated
Resume ratna rao updated
Ratna Rao yamani
 
Smart Annotation Processing - Marseille JUG
Smart Annotation Processing - Marseille JUGSmart Annotation Processing - Marseille JUG
Smart Annotation Processing - Marseille JUGgdigugli
 
Named Entity Recognition (NER) Using Automatic Summarization of Resumes
Named Entity Recognition (NER) Using Automatic Summarization of ResumesNamed Entity Recognition (NER) Using Automatic Summarization of Resumes
Named Entity Recognition (NER) Using Automatic Summarization of Resumes
IRJET Journal
 
Rajiv Ranjan ODI_Developer
Rajiv Ranjan ODI_DeveloperRajiv Ranjan ODI_Developer
Rajiv Ranjan ODI_Developer
Rajiv Agrawal
 
Ebs dba con4696_pdf_4696_0001
Ebs dba con4696_pdf_4696_0001Ebs dba con4696_pdf_4696_0001
Ebs dba con4696_pdf_4696_0001jucaab
 
Smart annotation processing - Paris JUG
Smart annotation processing - Paris JUGSmart annotation processing - Paris JUG
Smart annotation processing - Paris JUG
gdigugli
 

Similar to Object Relational Database Project (20)

Intro
IntroIntro
Intro
 
IMS504/IMS506
IMS504/IMS506IMS504/IMS506
IMS504/IMS506
 
Possible Algorithms of 2NF and 3NF for DBNorma- A tool for Relational Databas...
Possible Algorithms of 2NF and 3NF for DBNorma- A tool for Relational Databas...Possible Algorithms of 2NF and 3NF for DBNorma- A tool for Relational Databas...
Possible Algorithms of 2NF and 3NF for DBNorma- A tool for Relational Databas...
 
My C.V
My C.VMy C.V
My C.V
 
ananth_resume
ananth_resumeananth_resume
ananth_resume
 
Peoplesoft Basic App designer
Peoplesoft Basic App designerPeoplesoft Basic App designer
Peoplesoft Basic App designer
 
HA Hadoop -ApacheCon talk
HA Hadoop -ApacheCon talkHA Hadoop -ApacheCon talk
HA Hadoop -ApacheCon talk
 
Mydb 2010 - AbhijeetKalsi
Mydb 2010 - AbhijeetKalsiMydb 2010 - AbhijeetKalsi
Mydb 2010 - AbhijeetKalsi
 
iFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature ImplementationsiFL: An Interactive Environment for Understanding Feature Implementations
iFL: An Interactive Environment for Understanding Feature Implementations
 
An Hour of DB2 Tips
An Hour of DB2 TipsAn Hour of DB2 Tips
An Hour of DB2 Tips
 
Resume ratna rao updated
Resume ratna rao updatedResume ratna rao updated
Resume ratna rao updated
 
Resume_Ratna Rao updated
Resume_Ratna Rao updatedResume_Ratna Rao updated
Resume_Ratna Rao updated
 
Smart Annotation Processing - Marseille JUG
Smart Annotation Processing - Marseille JUGSmart Annotation Processing - Marseille JUG
Smart Annotation Processing - Marseille JUG
 
Veera Narayanaswamy_PLSQL_Profile
Veera Narayanaswamy_PLSQL_ProfileVeera Narayanaswamy_PLSQL_Profile
Veera Narayanaswamy_PLSQL_Profile
 
Named Entity Recognition (NER) Using Automatic Summarization of Resumes
Named Entity Recognition (NER) Using Automatic Summarization of ResumesNamed Entity Recognition (NER) Using Automatic Summarization of Resumes
Named Entity Recognition (NER) Using Automatic Summarization of Resumes
 
Rajiv Ranjan ODI_Developer
Rajiv Ranjan ODI_DeveloperRajiv Ranjan ODI_Developer
Rajiv Ranjan ODI_Developer
 
Ebs dba con4696_pdf_4696_0001
Ebs dba con4696_pdf_4696_0001Ebs dba con4696_pdf_4696_0001
Ebs dba con4696_pdf_4696_0001
 
Resume
ResumeResume
Resume
 
Resume
ResumeResume
Resume
 
Smart annotation processing - Paris JUG
Smart annotation processing - Paris JUGSmart annotation processing - Paris JUG
Smart annotation processing - Paris JUG
 

More from Sunny U Okoro

SQL Server and SSAS
SQL Server and SSAS SQL Server and SSAS
SQL Server and SSAS
Sunny U Okoro
 
BI Apps Reports 5 QlikSense Desktop
BI Apps Reports 5  QlikSense DesktopBI Apps Reports 5  QlikSense Desktop
BI Apps Reports 5 QlikSense Desktop
Sunny U Okoro
 
MS SSAS 2008 & MDX Reports
MS SSAS 2008 &  MDX Reports MS SSAS 2008 &  MDX Reports
MS SSAS 2008 & MDX Reports
Sunny U Okoro
 
DBA Oracle,SQL Server, MYSQL,DB2 Express Postgres & Sybase
DBA Oracle,SQL Server, MYSQL,DB2 Express Postgres & SybaseDBA Oracle,SQL Server, MYSQL,DB2 Express Postgres & Sybase
DBA Oracle,SQL Server, MYSQL,DB2 Express Postgres & Sybase
Sunny U Okoro
 
Database Migration
Database MigrationDatabase Migration
Database Migration
Sunny U Okoro
 
Cognos Express
Cognos ExpressCognos Express
Cognos Express
Sunny U Okoro
 
BI Apps ETL 4- Informatica PowerCenter Express
BI  Apps ETL 4- Informatica PowerCenter  ExpressBI  Apps ETL 4- Informatica PowerCenter  Express
BI Apps ETL 4- Informatica PowerCenter Express
Sunny U Okoro
 
BI Apps Reports 4 Cognos BI and Crystal Reports
BI Apps Reports 4  Cognos BI and Crystal ReportsBI Apps Reports 4  Cognos BI and Crystal Reports
BI Apps Reports 4 Cognos BI and Crystal ReportsSunny U Okoro
 
Tableau Reports and Oracle OBIEE
Tableau Reports and  Oracle OBIEETableau Reports and  Oracle OBIEE
Tableau Reports and Oracle OBIEESunny U Okoro
 
DB 3 Sybase ASE 15 & MS SQL Server
DB 3 Sybase ASE 15 & MS SQL Server DB 3 Sybase ASE 15 & MS SQL Server
DB 3 Sybase ASE 15 & MS SQL Server Sunny U Okoro
 
Advanced ETL2 Pentaho
Advanced ETL2  Pentaho Advanced ETL2  Pentaho
Advanced ETL2 Pentaho Sunny U Okoro
 
BI Apps Reports2- Oracle OBIEE & SAP Business Objects
BI Apps Reports2- Oracle OBIEE & SAP Business ObjectsBI Apps Reports2- Oracle OBIEE & SAP Business Objects
BI Apps Reports2- Oracle OBIEE & SAP Business ObjectsSunny U Okoro
 
MiS SharePoint 2010-SSRS, Power View & PowerPivot 2012
MiS SharePoint 2010-SSRS, Power View & PowerPivot 2012MiS SharePoint 2010-SSRS, Power View & PowerPivot 2012
MiS SharePoint 2010-SSRS, Power View & PowerPivot 2012Sunny U Okoro
 
BI Apps OLAP & Reports- SSAS 2012 Tabular & Multidimensional
BI Apps  OLAP & Reports- SSAS 2012 Tabular & Multidimensional BI Apps  OLAP & Reports- SSAS 2012 Tabular & Multidimensional
BI Apps OLAP & Reports- SSAS 2012 Tabular & Multidimensional Sunny U Okoro
 
Advanced SSRS 2012-SSAS,SSIS, XML, ASP.NET,Forms
Advanced SSRS 2012-SSAS,SSIS, XML, ASP.NET,FormsAdvanced SSRS 2012-SSAS,SSIS, XML, ASP.NET,Forms
Advanced SSRS 2012-SSAS,SSIS, XML, ASP.NET,FormsSunny U Okoro
 
Advanced ETL MS SSIS 2012 & Talend
Advanced ETL  MS  SSIS 2012 & Talend Advanced ETL  MS  SSIS 2012 & Talend
Advanced ETL MS SSIS 2012 & Talend Sunny U Okoro
 
DB Develop 2 Oracle 12c, DB2, MYSQL, SQL Anywhere 16
 DB Develop 2 Oracle 12c, DB2, MYSQL, SQL Anywhere 16  DB Develop 2 Oracle 12c, DB2, MYSQL, SQL Anywhere 16
DB Develop 2 Oracle 12c, DB2, MYSQL, SQL Anywhere 16 Sunny U Okoro
 
DB Security Oracle 11g-Application Context, Dynamic Views & Aduits
DB Security Oracle 11g-Application Context, Dynamic Views & AduitsDB Security Oracle 11g-Application Context, Dynamic Views & Aduits
DB Security Oracle 11g-Application Context, Dynamic Views & Aduits
Sunny U Okoro
 

More from Sunny U Okoro (20)

SQL Server and SSAS
SQL Server and SSAS SQL Server and SSAS
SQL Server and SSAS
 
BI Apps Reports 5 QlikSense Desktop
BI Apps Reports 5  QlikSense DesktopBI Apps Reports 5  QlikSense Desktop
BI Apps Reports 5 QlikSense Desktop
 
MS SSAS 2008 & MDX Reports
MS SSAS 2008 &  MDX Reports MS SSAS 2008 &  MDX Reports
MS SSAS 2008 & MDX Reports
 
DBA Oracle,SQL Server, MYSQL,DB2 Express Postgres & Sybase
DBA Oracle,SQL Server, MYSQL,DB2 Express Postgres & SybaseDBA Oracle,SQL Server, MYSQL,DB2 Express Postgres & Sybase
DBA Oracle,SQL Server, MYSQL,DB2 Express Postgres & Sybase
 
Database Migration
Database MigrationDatabase Migration
Database Migration
 
Cognos Express
Cognos ExpressCognos Express
Cognos Express
 
BI Apps ETL 4- Informatica PowerCenter Express
BI  Apps ETL 4- Informatica PowerCenter  ExpressBI  Apps ETL 4- Informatica PowerCenter  Express
BI Apps ETL 4- Informatica PowerCenter Express
 
Oracle ODI
Oracle ODIOracle ODI
Oracle ODI
 
BI Apps Reports 4 Cognos BI and Crystal Reports
BI Apps Reports 4  Cognos BI and Crystal ReportsBI Apps Reports 4  Cognos BI and Crystal Reports
BI Apps Reports 4 Cognos BI and Crystal Reports
 
Tableau Reports and Oracle OBIEE
Tableau Reports and  Oracle OBIEETableau Reports and  Oracle OBIEE
Tableau Reports and Oracle OBIEE
 
DB 3 Sybase ASE 15 & MS SQL Server
DB 3 Sybase ASE 15 & MS SQL Server DB 3 Sybase ASE 15 & MS SQL Server
DB 3 Sybase ASE 15 & MS SQL Server
 
MS SSAS 2012 & MDX
MS SSAS 2012  &  MDXMS SSAS 2012  &  MDX
MS SSAS 2012 & MDX
 
Advanced ETL2 Pentaho
Advanced ETL2  Pentaho Advanced ETL2  Pentaho
Advanced ETL2 Pentaho
 
BI Apps Reports2- Oracle OBIEE & SAP Business Objects
BI Apps Reports2- Oracle OBIEE & SAP Business ObjectsBI Apps Reports2- Oracle OBIEE & SAP Business Objects
BI Apps Reports2- Oracle OBIEE & SAP Business Objects
 
MiS SharePoint 2010-SSRS, Power View & PowerPivot 2012
MiS SharePoint 2010-SSRS, Power View & PowerPivot 2012MiS SharePoint 2010-SSRS, Power View & PowerPivot 2012
MiS SharePoint 2010-SSRS, Power View & PowerPivot 2012
 
BI Apps OLAP & Reports- SSAS 2012 Tabular & Multidimensional
BI Apps  OLAP & Reports- SSAS 2012 Tabular & Multidimensional BI Apps  OLAP & Reports- SSAS 2012 Tabular & Multidimensional
BI Apps OLAP & Reports- SSAS 2012 Tabular & Multidimensional
 
Advanced SSRS 2012-SSAS,SSIS, XML, ASP.NET,Forms
Advanced SSRS 2012-SSAS,SSIS, XML, ASP.NET,FormsAdvanced SSRS 2012-SSAS,SSIS, XML, ASP.NET,Forms
Advanced SSRS 2012-SSAS,SSIS, XML, ASP.NET,Forms
 
Advanced ETL MS SSIS 2012 & Talend
Advanced ETL  MS  SSIS 2012 & Talend Advanced ETL  MS  SSIS 2012 & Talend
Advanced ETL MS SSIS 2012 & Talend
 
DB Develop 2 Oracle 12c, DB2, MYSQL, SQL Anywhere 16
 DB Develop 2 Oracle 12c, DB2, MYSQL, SQL Anywhere 16  DB Develop 2 Oracle 12c, DB2, MYSQL, SQL Anywhere 16
DB Develop 2 Oracle 12c, DB2, MYSQL, SQL Anywhere 16
 
DB Security Oracle 11g-Application Context, Dynamic Views & Aduits
DB Security Oracle 11g-Application Context, Dynamic Views & AduitsDB Security Oracle 11g-Application Context, Dynamic Views & Aduits
DB Security Oracle 11g-Application Context, Dynamic Views & Aduits
 

Object Relational Database Project

  • 1. SUNTURST CONSULTING INC DATABASE PROJECT BY GROUP 12 DBST 652 University of Maryland University College Summer 2011 Saturday, November 26, 2011
  • 2. Contents Deliverable 1 – Project Charter........................................................................................... 2 Deliverable 2 - ERD............................................................................................................ 5 Deliverable 3 - Data Definition Language ........................................................................ 12 Deliverable 4 – Data Manipulation Language .................................................................. 18 Database Snappshot .......................................................................................................... 49 Deliverable 5 - SQL Queries............................................................................................. 62 Deliverable 6 -Database Maintenance Scripts .................................................................. 69 Deliverable 7 – Functons & Stored Procedure ................................................................ 75 Deliverable 8 -Explain Tool.............................................................................................. 79 Deliverable 9 - Object-Relational Exercises ..................................................................... 82 References ......................................................................................................................... 87 1
  • 3. Deliverable 1 – Project Charter Database Objective Objective of this project is to create an Employee Database which will store information about employees working for SunTrust Consulting Inc. SunTrust is IT consulting company which has assigned many projects to its several employees. This database will contain all the information about the employees working for the SunTrust , such as Employee’s ID, SSN, first name, Date of birth, home address, office phone number, emergency contacts, department, languages, salary etc. It also stores the information about project such as project ID, project name, the assigned employee and the number of hours worked by each employee. Currently, SunTrust Company is using an access, single user database, to record employee data. Moving this to multiuser database will enable individual employees to access most of the employee’s data online. At the same time, company executive can see the cost associated with each project. Purpose and benefits This multi user database will help HR to ease their workload by giving employees access to their data via web and letting them update their information. Moreover employees will be able to search the database and find contact information about other employees like addresses and phone numbers. Managers will have access to their employee’s data and project’s cost which can be used to make a better business decision. 2
  • 4. Furthermore, mangers would be able to create and finalize reports of projects like the average cost of each projects and total salary paid to each employee. Technical Detail This database will run in the UMUC Unix server dbcourse2 which will be accessed via PortalPutTTY terminal emulator using SSH network protocol. The software that would be used is Oracle 10g. Data definition language (DDL) would be used to create the database. Data manipulation language (DML) and Transaction control language (TCL) would also be utilized to manipulate the database and make changes or undo transactions to the database. Tools Microsoft Visio 2010 and Oracle Data Modeler would be used to create the Entity relationship diagram (ERD). Notepad +++ and notepad would be used to write and edit SQL statements. Microsoft Project 2007 would be used to create the project schedule. Project Schedule Please open the Microsoft Project file for complete project schedule attached with this document. 3
  • 5. Deliverable Deliverable Schedule Member Complete By 1 Project Charter June 5 2 ERD June 12 3 Data Definition Language June 19 June 26 4 Data Manipulation Language July 1 5 SQL Queries July 8 6 Database Maintenance Scripts July 24 7 Functons & Stored Procedure July 29 8 Explain Tool July 29 9 Object Relational Exercises 10 Lab Project Report August 5 Table 1 Project Schedule 4
  • 6. Deliverable 2 - ERD Dependent PK Depnd_Num First_Name Last_Name Dep_Dob FK1 Emp_ID Depend_Type Associated Department PK Dept_ID Employs Dept_Name Dept_Phone FK1 Dept_Mgr_ID Dept_Ext Managed Works Assignment EMPLOYEE PK Assignment_Num PK Emp_ID Manager Project Assign_Date PK Proj_Num First_Name Assign_Hours Last_Name Cost FK1 Proj_Mrg_ID SNN FK1 Emp_ID Proj_Name DOB FK2 Proj_Num Due_Date Emp_Rate Associated Assigned Gender FK1 Job_Code Managed FK2 Dept_ID Manager Contact Associated PK Contact_ID Associated FK1 Emp_ID Address Apt_Num City H_State Job Phone_Home Phone_Mobile PK Job_Code Phone_Work Description 5
  • 7. ERD Description Entity Description Emplpoyee Stores data about an employee Assignment Stores data relating to an assignment assigned to an employee Project Stores data of a project Department Stores data of a department Dependent Stores data of the dependent assiocated with an employee Job Stores data of a job Contact Stores the contact of an employee Table 2 ERD Description Constraints Primary keys Name Object Description dept_dept_id_pk Department Adds the primary key constraint to the department table. job_Job_Code_pk Job Adds the primary key constraint to the job table. PK_Proj_Num_pk Project Adds the primary key constraint to the project table. Emp_id_pk Employee Adds the primary key constraint to the employee table. assign_assigment_num_pk Assignment Adds the primary key constraint to the assignment table con_contact_id_pk Contact Adds the primary key constraint to contact table. depend_Depend_num_pk Dependent Adds the primary key constraint to the dependent table. Table 3 Primary Key Contraints 6
  • 8. Foreign Keys Name Object Description dept_dept_m8gr_id Department Adds the FK constraint linking Employee to Department using Employee PK column (Emp_ID) & Department (Dept_Mgr_ID) column. proj_proj_mgr_id_fk Project Adds the FK constraint linking Employee to Project using Employee PK column (Emp_ID) & Project (Proj_Mrg_ID) column. emp_dept_id_fk Adds the FK constraint linking Department Employee to Employee using Department PK column (Dept_ID) & Employe(Dept_ID) column. emp_job_code_fk Add the FK constraint linking Job to Employee using Job PK column (Job_Code) Table 4 Foreign Key Employee (Job_Code) column. & Constraint assign_Emp_Num_fk Adds the FK constraint linking Employee to Assignment Assignment using Employee PK column (Emp_ID) & Assignment (Emp_ID) column. assign_Proj_Num Adds the FK constraint linking Project to Assignment using Project PK column (Proj_Num) & Assignment (Proj_Num) column. Depend_Emp_id_fk Dependent Adds the FK constraint linking Employee to Dependent using Employee PK column (Emp_ID) & Dependent(Emp_ID) column. con_emp_id_fk Contact Adds the FK constraint linking Employee to Contact using Employee Pk column (Emp_ID) & Contact (Emp_ID) column. 7 Table 5 Not Null Constraint
  • 9. Not Null Name Object Description dept_ex_nn Department Adds the not null constraint to Dept_Ex column. dept_phone_nn Adds the not null constraint to Dept_Phone column. dept_name_nn Adds the not null constraint to Dept_Name column. job_description_nn Job Adds the not null constraint to the job_description column. proj_proj_mgr_id_nn Project Adds the not null constraint to the Proj_Mrg_ID column. proj_proj_name_nn Adds the not null constraint to the Proj_Name column. proj_due_date_nn Adds the not null constraint to Due_Date column. emp_last_name_nn Adds the not null constraint to Last_Name column. emp_dob_nn Adds the not null constraint to DOB column. Employee emp_emp_rate_nn Adds the not null constraint to Emp_Rate Column. Adds the Dept_ID column not null constraint dept_id_nn Adds the not null constraint to First_Name column. emp_First_name_nn enp_job_code Adds the not null constraint to the Job_code column. 8
  • 10. emp_gender_nn Adds the not null constraint to the Gender column. assign_emp_num_nn Adds the not null constraint to the Emp_ID column. assign_hours_nn Assignment Adds the not null constraint to Assign_Hours column. assign_project_nn Adds the not null constraint to Proj_Num column. depend_first_name_nn Adds the not null constraint to First_Name column. Dependent depend_last_name_nn Adds the not null constraint to Last_Name column. depend_dep_dob_mn Adds the not null constraint to the Dep_Dob column. depend_Emp_id_nn Adds the not null constraint to the Emp_ID column. depend_Depend_Type_nn Adds the not null constraint to Depend_Type column. Table 6 Not Null Constraint 9
  • 11. Relationships Relationship Name Entities Relationship Description Emp_Dpet Rel Employee & Department 1:M One or more employee works for a department. A department employes one or more employees Dep_Emp Rel Department& Employee 1:1 One and only one employee is the manger of a department. A department is managed by an employee. An employment is assigned to zero or more Emp_Assign Rel Employee & Assignment 1:M assignment(s). Zero or more assignment(s) is assiocated with an employee. Assign_Project Rel Assignment & Project 1:M One or more assignments can be assiocated with a project. A project can be assiocated with one or more assignments. Cont_Emp Rel Contact & Employee 1:M An employee is assiocated with one or more contact listing(s). One or more contact listing(s) is assiocated with an employee. Emp_Job Rel Employee & Job 1:M One or more employees can be assiocated with the same job type. A job type is assiocated with one or more employees. Depend_Emp Rel Dependent & Employee 1:1 One and only one depedent may be assiocated with an employee. 10
  • 12. Proj_Emp Rel Project & Employee 1:1 One and only one employee is the manager of a project. A project is managed by an employee. Table 7 Relationships 11
  • 13. Deliverable 3 - Data Definition Language /* creates the department table */ CREATE TABLE DEPARTMENT ( Dept_ID Number , Dept_Name VARCHAR2(50), Dept_Phone Number, Dept_Mgr_ID Number , Dept_Ext Number ); /* add the primary key constraint */ Alter table department add constraint dept_dept_id_pk primary key (dept_id); /* add the not null constraint */ Alter table department modify (dept_ext constraint dept_ex_nn not null) modify ( dept_phone constraint dept_phone_nn not null) modify (dept_name constraint dept_name_nn not null); /* adds the foreign key constraint to the department table */ Alter table department add constraint dept_dept_mgr_id_fk foreign key (dept_mgr_id) references employee (emp_id); /* creates the unique number for the pk columns */ create sequence dept_dept_id_seq start with 0400 increment by 5 Nocycle ; /* creates the job table */ CREATE TABLE JOB ( 12
  • 14. Job_code Number, Description VARCHAR2(50) CONSTRAINT job_description_nn not null ); /*end of statement*/ /* creates the primary key constraint*/ Alter table job add constraint job_Job_Code_pk PRIMARY KEY(Job_Code) /*end*/ /* creates the table project*/ CREATE TABLE PROJECT ( Proj_Num Number , Proj_Mgr_ID Number, Proj_name VARCHAR2(50), Due_Date DATE ); /* end */ /* creates pk constraint for the project table */ Alter table project add CONSTRAINT PK_Proj_Num_pk PRIMARY KEY(Proj_Num); /* create the foreign key constraint for project table */ Alter table project add constraint proj_proj_mgr_id_fk foreign key (proj_mgr_id) references employee (emp_id); /* end of sql */ /* creates the null constraints for project table * */ Alter table project modify( proj_mgr_id constraint proj_proj_mgr_id_nn not null ) modify (proj_name constraint proj_proj_name_nn not null) modify( due_date constraint proj_due_date_nn not null); /* end sql */ 13
  • 15. /* creates the employee table */ CREATE TABLE EMPLOYEE (Emp_id Number , First_Name VARCHAR2(50), Last_Name VARCHAR2(50), SSN VARCHAR2(11), Dob DATE, Emp_Rate Number(10,2), Dept_ID number , Gender varchar2(6), Job_Code number ); /* end */ /* add the primary key constraint */ Alter table employee add constraint Emp_id_pk PRIMARY KEY(Emp_id); /* adds the null constraints to the columnn */ Alter table employee modify( last_name constraint emp_last_name_nn not null) modify ( dob constraint emp_dob_nn not null) modify ( emp_rate constraint emp_emp_rate_nn not null) modify ( dept_id constraint dept_id_nn not null) modify( first_name constraint emp_First_name_nn NOT NULL) modify ( job_code constraint emp_job_code_nn not null) modify ( gender constraint emp_gender_nn not null); /* adds the foreign key constraint */ Alter table employee add CONSTRAINT EMP_dept_id_fk FOREIGN KEY(Dept_ID) REFERENCES DEPARTMENT(Dept_ID) ; Alter table employee add CONSTRAINT Emp_job_code_fk FOREIGN KEY(Job_Code) REFERENCES JOB(Job_Code); /* sql ends */ 14
  • 16. /* creates the assignment table*/ CREATE TABLE ASSIGNMENT ( Assignment_Num Number, Assign_Date DATE, Assign_Hours Number(10,2), Cost Number(20,2), Emp_id number, Proj_Num number ); /*ends*/ /* creates the constraints for assignment */ Alter table ASSIGNMENT add constraint assign_assigment_num_pk primary key ( Assignment_Num ); Alter table ASSIGNMENT modify ( assign_date constraint assign_emp_num_nn not null) modify ( assign_hours constraint assign_hours_nn not null) modify ( emp_id constraint assign_emp_num not null) modify ( proj_num constraint assign_project_nn not null ); Alter table ASSIGNMENT add CONSTRAINT assign_Emp_Num_fk FOREIGN KEY(Emp_id) REFERENCES EMPLOYEE(Emp_id) Alter table ASSIGNMENT add CONSTRAINT assign_Proj_Num FOREIGN KEY(Proj_num) REFERENCES PROJECT(Proj_num); /*ends*/ /* creates the table for contact*/ Create table contact ( contact_id number, Emp_ID number, Address varchar2(50), Apt_Num varchar2(50), City varchar2(30), H_State varchar2(3), Phone_Home number, phone_Mobile number, Phone_Work number ); 15
  • 17. /* end */ /* creates the pk constraint */ Alter table contact add constraint con_contact_id_pk primary key ( contact_id, emp_id); /* creates the fk constraint */ Alter table contact add constraint con_emp_id_fk foreign key (emp_id) references employee (emp_id); /* add column */ Alter table contact add email_office varchar2(40); /*creates the sequence value for the assignment pk value*/ create sequence assign_assign_num_seq start with 05020 increment by 12 Nocycle /*ends*/ /* change sequence */ Alter sequence emp_ssn_seq increment by 589874 /*produce unique numbers for pk columns. The database creates the number */ create sequence emp_emp_id_seq start with 030404 increment by 130 Nocycle ; /* create unique number for ssn*/ create sequence emp_ssn_seq start with 201342019 increment by 1200 Nocycle /* creates unique constraint for ssn*/ 16
  • 18. Alter table employee add constraint emp_emp_ssn_uk unique (ssn); /* changed the sequence value*/ Alter sequence emp_ssn_seq increment by 498989 Nocycle; /*ends*/ /* creates the unique sequence for pk column */ Create sequence con_contact_id_seq start with 00020 increment by 123; nocycle; /* creates the unique number for project_num */ create sequence proj_proj_num_seq start with 0900 increment by 5 Nocycle /* end */ 17
  • 19. Deliverable 4 – Data Manipulation Language /* inserts records into the department*/ Insert into department( dept_id, dept_name, dept_phone, dept_ext) values ( dept_dept_id_seq.nextval, 'Quality Assurance', 2122028259, 8260); Insert into department( dept_id, dept_name, dept_phone, dept_ext) values ( dept_dept_id_seq.nextval, 'Software Engineering', 2122028259, 6821); Insert into department( dept_id, dept_name, dept_phone, dept_ext) values ( dept_dept_id_seq.nextval, 'System' , 2122028259, 1926); Insert into department( dept_id, dept_name, dept_phone, dept_ext) values ( dept_dept_id_seq.nextval, 'Network Systems', 2122028259, 4041); Insert into department( dept_id, dept_name, dept_phone, dept_ext) values ( dept_dept_id_seq.nextval, 'Database Systems', 2122028259, 5080); Insert into department( dept_id, dept_name, dept_phone, dept_ext) values ( dept_dept_id_seq.nextval, 'Project Management',2122028259, 8070); Insert into department( dept_id, dept_name, dept_phone, dept_ext) values ( dept_dept_id_seq.nextval, 'Accounting and Finance' ,2122028259,9090); /* end of the insert statement*/ /* update department to include department manager id */ update department set dept_mgr_id = ( select emp_id from employee where emp_id = 35084) where dept_id = (select emp_id from employee where emp_id = 400); update department set dept_mgr_id = ( select emp_id from employee where emp_id = 34174) where dept_id = ( select dept_id from department where dept_id = 405); update department set dept_mgr_id = (select emp_id from employee where emp_id = 30534 ) 18
  • 20. where dept_id = ( select dept_id from department where dept_id = 410); update department set dept_mgr_id = select emp_id from employee where emp_id = 35734 ) where dept_id = ( select dept_id from department where dept_id = 415); update department set dept_mgr_id = (select emp_id from employee where emp_id = 33264) where dept_id = (select dept_id from employee where dept_id = 420) ; update department set dept_mgr_id = (select emp_id from employee where emp_id = 35344 ) where dept_id = ( select emp_id from employee where emp_id 425); update department set dept_mgr_id = (select emp_id from employee where emp_id = 36124 ) where dept_id = ( select dept_id from department where dept_id = 430); /*end*/ /* insert records into the job table */ insert into job (job_code,description) values ( job_job_code_seq.nextval, 'C++/.Net Developer'); insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Java Developer'); commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Php/ Java Script Developer') commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'HTML/XHTML Developer') commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Python Developer') commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Database Analyst'); commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Database Developer'); commit; 19
  • 21. insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Data Modeler'); commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'System Analyst'): commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Systems Engineer' ); commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Systems Administrator'); commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Database Administrator'); commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Technical Writter'); commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Project Manager' ); commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Network Engineer' ); commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Network Specialist' ); commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Network Security Specialist' ); commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Graphics Specialist' ); commit; 20
  • 22. insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Payroll Specialist' ); commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Inventory Specialist' ); commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'Test Analyst' ); commit; insert into job (job_code,description) values ( job_job_code_seq.nextval, 'system Analyst' ); commit; /* end of the insert statement*/ /* inserts the records into the project table*/ Insert into project (proj_num, proj_mgr_id, proj_name,due_date) values (proj_proj_num_seq.nextval, (select emp_id from employee where emp_id = 35604), 'New York Ticket Corp Payment System', to_date ('09-sep-2010', 'dd-mon-yyyy') ); Insert into project (proj_num, proj_mgr_id, proj_name,due_date) values (proj_proj_num_seq.nextval, (select emp_id from employee where emp_id = 35604), 'St Paul College Web System Development', to_date('02-feb-2011', 'dd-mon-yyyy')); Insert into project (proj_num, proj_mgr_id, proj_name,due_date) values (proj_proj_num_seq.nextval, (select emp_id from employee where emp_id =35474 ), 'Citizens Bank Databae Development', to_date('09-AUG-2012', 'dd-mon-yyyy')); Insert into project (proj_num, proj_mgr_id, proj_name,due_date) values (proj_proj_num_seq.nextval, (select emp_id from employee where emp_id = 35344 ), 'WBBMN Urban TV System Development', 21
  • 23. to_date('27-Dec-2013', 'dd-mon-yyyy')); /* end of sql */ /* inserts records into the employee table*/ /* system enginner employee*/ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Sunny','McCook', emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =410), (select job_code from job where job_code = 70), TO_DATE('29-MAR-1978','DD-MON-YYYY '), 'Male' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Mariah', 'Johnson', emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =410), (select job_code from job where job_code = 70), TO_DATE('19-feb-1955','DD-MON-YYYY '), 'female' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'James', 'Imgram', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =410), (select job_code from job where job_code = 70), TO_DATE( '20-jan-1950','DD-MON-YYYY '), 'male' ); /*end */ /*system admin sql insert */ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Joel', 'Roland', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =410), (select job_code from job where job_code = 75), TO_DATE( '20-dec-1950','DD-MON-YYYY '), 'male' 22
  • 24. ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Susan', 'Noah', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =410), (select job_code from job where job_code = 75), TO_DATE( '10-apr-1964','DD-MON-YYYY '), 'female' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Peter', 'Wolf', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =410), (select job_code from job where job_code = 75), TO_DATE( '15-sep-1955','DD-MON-YYYY '), 'male' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender ) values (emp_emp_id_seq.nextval , 'Marxwall', 'Luther', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =410), (select job_code from job where job_code = 75), TO_DATE( '15-jan-1952','DD-MON-YYYY '), 'male' ); /* end sql / /*system analyst*/ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Fox','Christopher', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =410), (select job_code from job where job_code = 130), TO_DATE( '19- july-1977','DD-MON-YYYY '), 'male' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Deng', 'Alian', emp_ssn_seq.nextval, 30, (select dept_id from department where dept_id =410), (select job_code from job where job_code = 130), TO_DATE( '04-jun-1988', 'DD-MON-YYYY '), 'male'); 23
  • 25. /*end*/ /*database admins*/ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Jessica', 'Andy', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 80), TO_DATE( '01-Aug-1962','DD-MON-YYYY '), 'female' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Shirly', 'Davis', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 80), TO_DATE( '18-Aug-1962','DD-MON-YYYY '), 'female' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Mathew', 'Brain', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 80), TO_DATE( '14-Aug-1980','DD-MON-YYYY '), 'male' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Tyron', 'Banks', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 80), TO_DATE( '18-sep-1983','DD-MON-YYYY '), 'male' ); /*end / /* db developer*/ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Donna', 'Haris', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 60), TO_DATE( '12-oct-1982','DD-MON-YYYY '), 'female' 24
  • 26. ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Linda', 'Mark', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 60), TO_DATE( '12-jul-1982','DD-MON-YYYY '), 'female' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Ruth', 'Baker', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 60), TO_DATE( '19-mar-1975','DD-MON-YYYY '), 'female' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Kevin', 'Kenneth', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 60), TO_DATE( '09-mar-1975','DD-MON-YYYY '), 'male' ); /* db developer end * / /* database modeler employee */ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Isabella', 'Clinton' , emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 65), TO_DATE( '11-oct-1975','DD-MON-YYYY '), 'female' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Sanford', 'Brown' , emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 65), TO_DATE( '08-nov-1972','DD-MON-YYYY '), 'male' ); 25
  • 27. Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Vonda', 'Ikenna' , emp_ssn_seq.nextval, 30, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 65), TO_DATE( '06-jun-1985','DD-MON-YYYY '), 'female' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Celina', 'Tobi' , emp_ssn_seq.nextval, 30, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 65), TO_DATE( '16-mar-1986','DD-MON-YYYY '), 'female' ); /* end of sql */ /* database analyst */ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Brenda', 'Bell' , emp_ssn_seq.nextval, 30, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 55), TO_DATE( '16-mar-1988','DD-MON-YYYY '), 'female' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Jaqueline', 'king' , emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 55), TO_DATE( '04-aug-1967','DD-MON-YYYY '), 'female' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Roland', 'king' , emp_ssn_seq.nextval, 30, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 55), TO_DATE( '04-jan-1987','DD-MON-YYYY '), 'male' 26
  • 28. ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Michael', 'Stevens', emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =420), (select job_code from job where job_code = 55), TO_DATE( '25-dec-1974','DD-MON-YYYY '), 'male' ); /*end of statement*/ /* java*/ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Carol', 'Washington' , emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =405), (select job_code from job where job_code = 50), TO_DATE( '12-jul-1984','DD-MON-YYYY '), 'female' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Rebeca', 'Peterson', emp_ssn_seq.nextval, 30, (select dept_id from department where dept_id =405), (select job_code from job where job_code = 50), TO_DATE( '21-oct-1987','DD-MON-YYYY '), 'female' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Cherri', 'Keys', emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =405), (select job_code from job where job_code = 50), TO_DATE( '25-apr-1983','DD-MON-YYYY '), 'female' ); /*end of statement */ /*php/java scripts*/ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Jerry','Springfield', emp_ssn_seq.nextval, 30, 27
  • 29. (select dept_id from department where dept_id =405), (select job_code from job where job_code = 135), TO_DATE( '18-feb-1979 ','DD-MON-YYYY '), 'male' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Carlos', 'Winworth', emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =405), (select job_code from job where job_code =135), TO_DATE( '28-dec-1958','DD-MON-YYYY '), 'male' ); /*end*/ /* c++ developer */ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Patrick', 'law', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =405), (select job_code from job where job_code = 45), TO_DATE( '20-feb-1962','DD-MON-YYYY '), 'male' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Jonas', 'lake' ,emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =405), (select job_code from job where job_code = 45), TO_DATE( '28-feb-1963','DD-MON-YYYY '), 'male' ); /*end*/ /* HTRML/XHTML*/ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Addie', 'Jude', emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =405), (select job_code from job where job_code = 140), TO_DATE( '19-may-1973','DD-MON-YYYY '), 'female' ); 28
  • 30. Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Adams', 'Wade' ,emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =405), (select job_code from job where job_code = 140), TO_DATE( '20-sep-1975','DD-MON-YYYY '), 'male' ); /*end*/ /* phython */ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Robert', 'Lopez', emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =405), (select job_code from job where job_code = 145), TO_DATE( '2-jan -1983','DD-MON-YYYY '), 'male' ); /*end*/ /* technical writer*/ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Ray', 'Richmond', emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =400), (select job_code from job where job_code = 85), TO_DATE( '2-oct-1982','DD-MON-YYYY '), 'male' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Zack','Richmond', emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =400), (select job_code from job where job_code = 85), TO_DATE( '2-jan-1963','DD-MON-YYYY '), 'male' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Ashland', 'Kedzie', emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =400), 29
  • 31. (select job_code from job where job_code = 85), TO_DATE( '06-jul-1969','DD-MON-YYYY '), 'female' ); /*end */ /*project manager*/ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Joel' , 'Jeremiah', emp_ssn_seq.nextval, 60, (select dept_id from department where dept_id =425), (select job_code from job where job_code = 90), TO_DATE( '20-oct-1958','DD-MON-YYYY '), 'male' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Zack','Isaiah', emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =425), (select job_code from job where job_code = 90), TO_DATE( '13-oct-1966','DD-MON-YYYY '), 'male' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Ashland', 'Macnell', emp_ssn_seq.nextval, 50, (select dept_id from department where dept_id =425), (select job_code from job where job_code = 90), TO_DATE( '06-jul-1969','DD-MON-YYYY '), 'female' ); /*end*/ /*network specialist*/ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Sam', 'Walteron', emp_ssn_seq.nextval,50, (select dept_id from department where dept_id =415), (select job_code from job where job_code = 95), TO_DATE( '14-apr-1951','DD-MON-YYYY '), 'male' ); 30
  • 32. Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Jacob', 'Henson', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =415), (select job_code from job where job_code = 100), TO_DATE( '13-jan-1970','DD-MON-YYYY '), 'male' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Lee', 'Chin', emp_ssn_seq.nextval, 30, (select dept_id from department where dept_id =415), (select job_code from job where job_code = 105), TO_DATE( '09-sep-1984', 'DD-MON-YYYY '), 'male'); /*end*/ /*accounting and fianace */ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Rose', 'Henson', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =430), (select job_code from job where job_code = 115), TO_DATE( '13-jan-1970','DD-MON-YYYY '), 'female' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Jackie', 'Hopewell', emp_ssn_seq.nextval, 30, (select dept_id from department where dept_id =430), (select job_code from job where job_code = 120), TO_DATE( '09-sep-1984', 'DD-MON-YYYY '), 'female'); /*end*/ /*test analyst*/ Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Derick', 'Charles', emp_ssn_seq.nextval, 40, (select dept_id from department where dept_id =400), (select job_code from job where job_code = 125), 31
  • 33. TO_DATE( '25-july-1970','DD-MON-YYYY '), 'male' ); Insert into employee (emp_id, first_name, last_name, ssn, emp_rate, dept_id, job_code, dob, gender) values (emp_emp_id_seq.nextval , 'Lou', 'Shih', emp_ssn_seq.nextval, 30, (select dept_id from department where dept_id =400), (select job_code from job where job_code = 125), TO_DATE( '04-jun-1989', 'DD-MON-YYYY '), 'female'); /*end*/ /* insert records of employees associated with project */ /* projct 900 */ insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 1200 , (select emp_id from employee where emp_id = 34434) , (select proj_num from project where proj_num = 900 ) ); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 900 , (select emp_id from employee where emp_id = 34304) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 900 ,(select emp_id from employee where emp_id = 33914) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 900 , (select emp_id from employee where emp_id = 33784) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 890 32
  • 34. , (select emp_id from employee where emp_id = 34174 ) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 890 , (select emp_id from employee where emp_id =34564 ) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 890 , (select emp_id from employee where emp_id = 35084) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 890 , (select emp_id from employee where emp_id =34954) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 890 , (select emp_id from employee where emp_id = 36514) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 989 , (select emp_id from employee where emp_id = 36384) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 1000 , (select emp_id from employee where emp_id = 30664 ) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 400 , (select emp_id from employee where emp_id = 30534 ) , (select proj_num from project where proj_num = 900)); 33
  • 35. insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 980 , (select emp_id from employee where emp_id = 31054) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 800 , (select emp_id from employee where emp_id = 31314 ) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 690 , (select emp_id from employee where emp_id = 33394 ) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 550 , (select emp_id from employee where emp_id = 33264 ) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun-2008', 'dd-mon-yyyy'), 1200, (select emp_id from employee where emp_id = 32224) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun-2008', 'dd-mon-yyyy'), 980, (select emp_id from employee where emp_id = 32094) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun -2008', 'dd-mon-yyyy'), 550 , (select emp_id from employee where emp_id = 32874 ) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun-2008', 'dd-mon-yyyy'), 1200, 34
  • 36. (select emp_id from employee where emp_id = 31704 ) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun-2008', 'dd-mon-yyyy'), 980, (select emp_id from employee where emp_id = 35994) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun-2008', 'dd-mon-yyyy'), 1200, (select emp_id from employee where emp_id = 36124 ) , (select proj_num from project where proj_num = 900)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-jun-2008', 'dd-mon-yyyy'), 980, (select emp_id from employee where emp_id = 36254 ) , (select proj_num from project where proj_num = 900)); /* project num 905 */ insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 980 , (select emp_id from employee where emp_id = 35214) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 780 , (select emp_id from employee where emp_id = 36384) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 890 , (select emp_id from employee where emp_id = 34824) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 400 , (select emp_id from employee where emp_id = 34044) , (select proj_num from project where proj_num = 55)); 35
  • 37. insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 400, (select emp_id from employee where emp_id = 34174) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 500, (select emp_id from employee where emp_id = 34434) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 800, (select emp_id from employee where emp_id = 34304) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 789, (select emp_id from employee where emp_id = 33784 ) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 789, (select emp_id from employee where emp_id = 32224 ) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 890, (select emp_id from employee where emp_id = 32484) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 900, (select emp_id from employee where emp_id = 32744) , (select proj_num from project where proj_num = 905)); 36
  • 38. insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 989, (select emp_id from employee where emp_id = 30404) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'),900, (select emp_id from employee where emp_id = 30924 ) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 1500, (select emp_id from employee where emp_id = 31834) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 1400, (select emp_id from employee where emp_id = 31444) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 699, (select emp_id from employee where emp_id = 35994) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 850, (select emp_id from employee where emp_id = 35864) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 90, (select emp_id from employee where emp_id = 36124) , (select proj_num from project where proj_num = 905)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 850, (select emp_id from employee where emp_id = 36254) , (select proj_num from project where proj_num = 905)); 37
  • 39. insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('06-dec-2009', 'dd-mon-yyyy'), 850, (select emp_id from employee where emp_id = 33134) , (select proj_num from project where proj_num = 905)); /*end of project 905 */ /* project 910 */ insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 1800, (select emp_id from employee where emp_id = 33654 ) , (select proj_num from project where proj_num = 910)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 1200, (select emp_id from employee where emp_id = 33524 ) , (select proj_num from project where proj_num = 910)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 1340, (select emp_id from employee where emp_id = 32354) , (select proj_num from project where proj_num = 910)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 980, (select emp_id from employee where emp_id = 33004) , (select proj_num from project where proj_num = 910)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 1050, (select emp_id from employee where emp_id = 32614 ) , (select proj_num from project where proj_num = 910)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 1300, (select emp_id from employee where emp_id = 31184 ) , (select proj_num from project where proj_num = 910)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) 38
  • 40. values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 290, (select emp_id from employee where emp_id = 30794) , (select proj_num from project where proj_num = 910)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 800, (select emp_id from employee where emp_id = 31964 ) , (select proj_num from project where proj_num = 910)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('01-feb-2011', 'dd-mon-yyyy'), 780, (select emp_id from employee where emp_id = 31574) , (select proj_num from project where proj_num = 910)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('27-dec-2010', 'dd-mon-yyyy'), 550, (select emp_id from employee where emp_id = 34694 ) , (select proj_num from project where proj_num = 910)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('27-dec-2010', 'dd-mon-yyyy'), 650, (select emp_id from employee where emp_id = 35734 ) , (select proj_num from project where proj_num = 910)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('27-dec-2010', 'dd-mon-yyyy'), 890, (select emp_id from employee where emp_id = 34434 ) , (select proj_num from project where proj_num = 910)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('27-dec-2010', 'dd-mon-yyyy'), 900, (select emp_id from employee where emp_id = 32224 ) , (select proj_num from project where proj_num = 910)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('27-dec-2010', 'dd-mon-yyyy'), 900, (select emp_id from employee where emp_id = 30404) , (select proj_num from project where proj_num = 910)); 39
  • 41. insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('27-dec-2010', 'dd-mon-yyyy'), 1200, (select emp_id from employee where emp_id = 31834 ) , (select proj_num from project where proj_num = 910)); insert into ASSIGNMENT(Assignment_Num, Assign_Date, Assign_Hours, emp_id, proj_num) values ( assign_assign_num_seq.nextval, to_date('27-dec-2010', 'dd-mon-yyyy'), 550, (select emp_id from employee where emp_id = 34174) , (select proj_num from project where proj_num = 910)); /* update assign hours*/ update assignment set assign_hours = 1200 where ASSIGNMENT_NUM = 5824 /*end sql*/ /*end*/ /* updates the cost for each employee based on their pay rate */ update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num =5296 ) where emp_id = 35214 and Assignment_Num =5296 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num =5308 ) where emp_id = 36384 and Assignment_Num =5308 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num =5320) where emp_id = 34824 and Assignment_Num =5320 ; 40
  • 42. update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num =5344 ) where emp_id = 34174 and Assignment_Num =5344 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num =5356 ) where emp_id = 34434 and Assignment_Num =5356 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num =5368) where emp_id = 34044 and Assignment_Num =5368 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num =5380) where emp_id =33784 and Assignment_Num = 5380; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num =5392) where emp_id = 34304 and Assignment_Num =5392 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num =5404) where emp_id = 32224 and Assignment_Num =5404 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num =5416) where emp_id = 32484 and Assignment_Num =5416 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5428) where emp_id = 32744 41
  • 43. and Assignment_Num = 5428 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5440) where emp_id = 30404 and Assignment_Num = 5440 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5452) where emp_id = 30924 and Assignment_Num = 5452 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5464) where emp_id = 31834 and Assignment_Num = 5464; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5488) where emp_id = 35994 and Assignment_Num = 5488; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5500) where emp_id = 35864 and Assignment_Num = 5500; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5476 ) where emp_id = 31444 and Assignment_Num = 5476; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5512 ) where emp_id = 36124 and Assignment_Num = 5512; 42
  • 44. update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5524 ) where emp_id = 36254 and Assignment_Num = 5524 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5536 ) where emp_id = 33134 and Assignment_Num = 5536; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5188 ) where emp_id = 33394 and Assignment_Num = 5188; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5200 ) where emp_id = 33264 and Assignment_Num = 5200; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5212) where emp_id = 32224 and Assignment_Num = 5212; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5224 ) where emp_id = 32094 and Assignment_Num = 5224 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5236 ) where emp_id = 32874 and Assignment_Num = 5236; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5248 ) where emp_id = 31704 43
  • 45. and Assignment_Num = 5248; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5260 ) where emp_id = 35994 and Assignment_Num = 5260 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5272) where emp_id = 36124 and Assignment_Num = 5272; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5020) where emp_id = 34434 and Assignment_Num = 5020; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5032 ) where emp_id = 34304 and Assignment_Num = 5032 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5044 ) where emp_id = 33914 and Assignment_Num = 5044 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5056 ) where emp_id = 33784 and Assignment_Num = 5056 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5068 ) where emp_id = 34174 and Assignment_Num = 5068; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5080) where emp_id = 34564 and Assignment_Num = 5080 ; 44
  • 46. update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5092 ) where emp_id = 35084 and Assignment_Num = 5092; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5104 ) where emp_id = 34954 and Assignment_Num = 5104 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5116 ) where emp_id = 36514 and Assignment_Num = 5116; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5128 ) where emp_id = 36384 and Assignment_Num = 5128 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5140 ) where emp_id = 30664 and Assignment_Num = 5140 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5152) where emp_id = 30534 and Assignment_Num = 5152; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5164 ) where emp_id = 31054 and Assignment_Num = 5164 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5176 ) where emp_id = 31314 and Assignment_Num = 5176; 45
  • 47. update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 91608) where emp_id = 36254 and Assignment_Num = 91608; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5284 ) where emp_id = 36254 and Assignment_Num = 5284 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5608 ) where emp_id = 33654 and Assignment_Num = 5608; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5620 ) where emp_id = 33524 and Assignment_Num = 5620; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5632) where emp_id = 32354 and Assignment_Num = 5632 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5644 ) where emp_id = 33004 and Assignment_Num = 5644 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5656) where emp_id = 31184 and Assignment_Num = 5656; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5680 ) where emp_id = 30794 and Assignment_Num = 5680; 46
  • 48. update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5668) where emp_id = 32614 and Assignment_Num = 5668 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5692 ) where emp_id = 31964 and Assignment_Num = 5692 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5704 ) where emp_id = 31574 and Assignment_Num = 5704 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5740 ) where emp_id = 34694 and Assignment_Num = 5740; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5752) where emp_id = 35734 and Assignment_Num = 5752 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5764 ) where emp_id = 34434 and Assignment_Num = 5764 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5776 ) where emp_id = 32224 and Assignment_Num = 5776; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5788 ) where emp_id = 30404 and Assignment_Num = 5788 ; update assignment 47
  • 49. set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5812 ) where emp_id = 31834 and Assignment_Num = 5812 ; update assignment set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment a on e.emp_id = a.emp_id where a.Assignment_Num = 5824) where emp_id = 34174 and Assignment_Num = 5824; /*end*/ /* inserts the record for employee contact information */ insert into contact (contact_id, emp_id, address, city, h_state, phone_home, phone_work, email_office) values (con_contact_id_seq.nextval, ( select emp_id from employee where emp_id = 35474), '8080 W Maddison', 'City Heights', 'NJ', 2029091840, 82500920, 'ray.rich@sunlife.com'); insert into contact (contact_id, emp_id, address, city, h_state, phone_home, phone_work, email_office) values (con_contact_id_seq.nextval, ( select emp_id from employee where emp_id = 30794), '909 E Hudson', 'New York City', 'NY', 2098908860, 82500922, 'zach.rich@sunlife.com') ; insert into contact (contact_id, emp_id, address, apt_num, city, h_state, phone_home, phone_work, email_office) values (con_contact_id_seq.nextval, ( select emp_id from employee where emp_id = 34434), '4040 E Fifth Ave', '18GC', 'New York City', 'NY', 2013499292, 82500924, 'ashland.kediz@sunlife.com'); insert into contact (contact_id, emp_id, address, apt_num, city, h_state, phone_home, phone_work, email_office) values (con_contact_id_seq.nextval, ( select emp_id from employee where emp_id = 30404), '1900 S Lake Pine Dr', '2d', 'New England', 'CT', 2420017540, 82500923, 'derick.charl@sunlife.com'); insert into contact (contact_id, emp_id, address, apt_num, city, h_state, phone_home, phone_work, email_office) values (con_contact_id_seq.nextval, ( select emp_id from employee where emp_id = 34174), '1200 S brodway Dr', '4c', 'New bedford Park', 'CT', 2123988019, 82500926, 'lou.shi@sunlife.com'); 48
  • 50. Database Snappshot The log file could not be captured with a web browser. The following captured pictures reprsents the database state. Figure 1 described issued command describes table structure for Department, Project and Employee. The describe isssued command in figure 2 describes the table structures for Job, Contact and Assiignment. 49
  • 51. Figure 1 Table Structures 50
  • 52. Figure 2 Table Structure 51
  • 53. Figure 3 Contact Table Data 52
  • 54. Figure 4 Department Table Data 53
  • 55. Figure 5 Project Table Data 54
  • 56. Figure 6 Employee Table Data 55
  • 57. Figure 7 Employee Table Data 56
  • 58. Figure 8 Assignment Table Data 57
  • 59. Figure 9 Assignment Table Data 58
  • 60. Figure 10 Assignment Table Data 59
  • 61. Figure 11 Job Table Data 60
  • 62. 61
  • 63. Deliverable 5 - SQL Queries /* Show me name of employess whose job code is 65 */ SELECT first_name, last_name, job_code from employee where job_code= '65'; First_Name Last_Name Job_Code Sanford Brown 65 Vonda Ikenna 65 Celina Tobi 65 Isabella Clinton 65 Table 8 /* Show me the total number of employess for different job codes */ SELECT job_code, count (*) as Total_number from employee Group by job_code; JOB_CODE TOTAL_NUMBER 115 1 125 2 70 3 135 2 105 1 60 4 50 3 45 2 145 1 140 2 85 3 130 2 65 4 55 4 62
  • 64. 95 1 90 3 100 1 120 1 75 4 80 4 Table 9 /* Show me the lowest rate for job code 65 */ select min(emp_rate) "Lowest Rate" from employee where job_code= '65' group by job_code; Lowest Rate 30 Table 10 /* Show me the name of employees with highest rate . List them by their first name*/ select first_name , last_name, emp_rate AS Lowest_emp_rate from employee where emp_rate = (select min(emp_rate) from employee ) order by first_name; FIRST_NAME LAST_NAME LOWEST_EMP_RATE Brenda Bell 30 Celina Tobi 30 Deng Alian 30 Jackie Hopewell 30 Jerry Springfield 30 Lee Chin 30 63
  • 65. Lou Shih 30 Table 11 /* subquery, Show the list of employees whose emp rate is greater than average rate */ select initcap(first_name) as FIRST_NAME, initcap (last_name) as LAST_NAME, initcap(gender) as GENDER, emp_rate from employee where emp_rate > ( select avg(emp_rate) from employee); FIRST_NAME LAST_NAME GENDER EMP_RATE Sanford Brown Male 50 Jaqueline King Female 50 Michael Stevens Male 50 Carol Washington Female 50 Cherri Keys Female 50 Carlos Winworth Male 50 Jonas Lake Male 50 Addie Jude Female 50 Adams Wade Male 50 Robert Lopez Male 50 Ray Richmond Male 50 Zack Richmond Male 50 Ashland Kedzie Female 50 Joel Jeremiah Male 60 Zack Isaiah Male 50 Ashland Macnell Female 50 Sam Walteron Male 50 Sunny Mccook Male 50 Mariah Johnson Female 50 Table 12 64
  • 66. /* Show the list of the employees who are working on the project assigned in the past 6 months */ Select e.first_name,e.last_name , a.assign_date, assignment_num from employee e, assignment a where e.emp_id=a.emp_id and assign_date > (add_months(sysdate, -6)) FIRST_NAME LAST_NAME ASSIGN_DATE ASSIGNMENT_NUM Joel Roland 01-FEB-11 5680 Marxwall Luther 01-FEB-11 5656 Jessica Andy 01-FEB-11 5704 Tyron Banks 01-FEB-11 5692 Ruth Baker 01-FEB-11 5632 Isabella Clinton 01-FEB-11 5668 Celina Tobi 01-FEB-11 5644 Table 13 /* Joining Three Tables.Show the name of employee , their ID, and project description whose projects are overdue today */ select emp_id, e.first_name, proj_name, p.due_date from employee e JOIN assignment a using(emp_id) JOIN project p using (proj_num) where due_date< sysdate 65
  • 67. EMP_ID FIRST_NAME PROJ_NAME DUE_DATE EMP_ID 32744 Sanford St Paul College Web System 02-FEB-11 32744 Development 32874 Vonda New York Ticket Corp 09-SEP-10 32874 Payment System 33134 Brenda St Paul College Web System 02-FEB-11 33134 Development 33264 Jaqueline New York Ticket Corp 09-SEP-10 33264 Payment System 33394 Roland New York Ticket Corp 09-SEP-10 33394 Payment System 33784 Rebeca St Paul College Web System 02-FEB-11 33784 Development 33784 Rebeca New York Ticket Corp 09-SEP-10 33784 Payment System 33914 Cherri New York Ticket Corp 09-SEP-10 33914 Payment System 34044 Jerry St Paul College Web System 02-FEB-11 34044 Development 34174 Carlos St Paul College Web System 02-FEB-11 34174 Development 34174 Carlos New York Ticket Corp 09-SEP-10 34174 Payment System 34304 Patrick St Paul College Web System 02-FEB-11 34304 Development 34304 Patrick New York Ticket Corp 09-SEP-10 34304 Payment System 34434 Jonas St Paul College Web System 02-FEB-11 34434 Development 34434 Jonas New York Ticket Corp 09-SEP-10 34434 66
  • 68. Payment System 34564 Addie New York Ticket Corp 09-SEP-10 34564 Payment System 34824 Robert St Paul College Web System 02-FEB-11 34824 Development 34954 Ray New York Ticket Corp 09-SEP-10 34954 Payment System 35084 Zack New York Ticket Corp 09-SEP-10 35084 Payment System 35214 Ashland St Paul College Web System 02-FEB-11 35214 Development 35864 Jacob St Paul College Web System 02-FEB-11 35864 Development 35994 Lee St Paul College Web System 02-FEB-11 35994 Development 35994 Lee New York Ticket Corp 09-SEP-10 35994 Payment System 36124 Rose St Paul College Web System 02-FEB-11 36124 Development 36124 Rose New York Ticket Corp 09-SEP-10 36124 Payment System 36254 Jackie St Paul College Web System 02-FEB-11 36254 Development 36254 Jackie New York Ticket Corp 09-SEP-10 36254 Payment System 36384 Derick St Paul College Web System 02-FEB-11 36384 Development 36384 Derick New York Ticket Corp 09-SEP-10 36384 Payment System 30404 Sunny St Paul College Web System 02-FEB-11 30404 Development 30534 Mariah New York Ticket Corp 09-SEP-10 30534 Payment System 67
  • 69. 30664 James New York Ticket Corp 09-SEP-10 30664 Payment System 30924 Susan St Paul College Web System 02-FEB-11 30924 Development 31054 Peter New York Ticket Corp 09-SEP-10 31054 Payment System 31314 Fox New York Ticket Corp 09-SEP-10 31314 Payment System 31444 Deng St Paul College Web System 02-FEB-11 31444 Development 31704 Shirly New York Ticket Corp 09-SEP-10 31704 Payment System 31834 Mathew St Paul College Web System 02-FEB-11 31834 Development 32094 Donna New York Ticket Corp 09-SEP-10 32094 Payment System 32224 Linda St Paul College Web System 02-FEB-11 32224 Development 32224 Linda New York Ticket Corp 09-SEP-10 32224 Payment System 32484 Kevin St Paul College Web System 02-FEB-11 32484 Development 36514 Lou New York Ticket Corp 09-SEP-10 36514 Payment System Table 14 68
  • 70. Deliverable 6 -Database Maintenance Scripts /* create the dependent table*/ CREATE TABLE DEPENDENT ( Depend_Num Number (5), First_Name VARCHAR2(50), Last_Name VARCHAR2(50), Dep_Dob DATE , Emp_id NUMBER, Depend_Type varchar2(20) ); /* create the sequence for the primary key for depend_num*/ create sequence depend_depend_num_seq start with 065000 increment by 13 Nocycle; /* creates the constraints assiocated with dependent table */ Alter table DEPENDENT modify (first_name CONSTRAINT depend_first_name_nn not null) modify (last_name CONSTRAINT depend_last_name_nn not null) modify (dep_DOB CONSTRAINT depend_dep_dob_mn not null ) modify (emp_id CONSTRAINT depend_Emp_id_nn NOT NULL) modify (Depend_Type CONSTRAINT depend_Depend_Type_nn NOT NULL); Alter table DEPENDENT add constraint depend_Depend_num_pk PRIMARY KEY (Depend_Num); Alter table DEPENDENT add CONSTRAINT Depend_Emp_id_fk FOREIGN KEY(Emp_id) REFERENCES EMPLOYEE(Emp_id); 69
  • 71. DML Statements insert into dependent (depend_num, first_name, last_name, dep_dob, emp_id, Depend_Type ) values ( depend_depend_num_seq.nextval, 'Nancy', 'Brown', to_date('18-oct-1969', 'dd-mon-yyyy'), (select emp.emp_id from employee emp where emp.emp_id = 32744), 'Wife' ); insert into dependent (depend_num, first_name, last_name, dep_dob, emp_id, Depend_Type ) values ( depend_depend_num_seq.nextval, 'John', 'Ikenna', to_date('08-dec-1985', 'dd-mon-yyyy'), (select emp.emp_id from employee emp where emp.emp_id = 32874), 'Husband' ); insert into dependent (depend_num, first_name, last_name, dep_dob, emp_id, Depend_Type ) values ( depend_depend_num_seq.nextval, 'Greg', 'Tobi', to_date('12-mar-1985', 'dd-mon-yyyy'), (select emp.emp_id from employee emp where emp.emp_id = 33004), 'Partner' ); insert into dependent (depend_num, first_name, last_name, dep_dob, emp_id, Depend_Type ) values ( depend_depend_num_seq.nextval, 'Mariah', 'Winfield', to_date('09-apr- 1969', 'dd-mon-yyyy'), (select emp.emp_id from employee emp where emp.emp_id = 33134), 'Partner' ); insert into dependent (depend_num, first_name, last_name, dep_dob, emp_id, Depend_Type ) values ( depend_depend_num_seq.nextval, 'luther', 'king', to_date('09-apr-1988', 'dd-mon-yyyy'), (select emp.emp_id from employee emp where emp.emp_id = 33394), 'Partner' ); 70