Object Relational Database Project

722 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
722
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Object Relational Database Project

  1. 1. SUNTURST CONSULTING INC DATABASE PROJECT BY GROUP 12 DBST 652University of Maryland University College Summer 2011 Saturday, November 26, 2011
  2. 2. ContentsDeliverable 1 – Project Charter........................................................................................... 2Deliverable 2 - ERD............................................................................................................ 5Deliverable 3 - Data Definition Language ........................................................................ 12Deliverable 4 – Data Manipulation Language .................................................................. 18Database Snappshot .......................................................................................................... 49Deliverable 5 - SQL Queries............................................................................................. 62Deliverable 6 -Database Maintenance Scripts .................................................................. 69Deliverable 7 – Functons & Stored Procedure ................................................................ 75Deliverable 8 -Explain Tool.............................................................................................. 79Deliverable 9 - Object-Relational Exercises ..................................................................... 82References ......................................................................................................................... 87 1
  3. 3. Deliverable 1 – Project CharterDatabase Objective Objective of this project is to create an Employee Database which will storeinformation about employees working for SunTrust Consulting Inc. SunTrust is ITconsulting company which has assigned many projects to its several employees. This database will contain all the information about the employees working forthe SunTrust , such as Employee’s ID, SSN, first name, Date of birth, home address,office phone number, emergency contacts, department, languages, salary etc. It alsostores the information about project such as project ID, project name, the assignedemployee and the number of hours worked by each employee. Currently, SunTrust Company is using an access, single user database, to recordemployee data. Moving this to multiuser database will enable individual employees toaccess most of the employee’s data online. At the same time, company executive can seethe cost associated with each project.Purpose and benefits This multi user database will help HR to ease their workload by giving employeesaccess to their data via web and letting them update their information. Moreoveremployees will be able to search the database and find contact information about otheremployees like addresses and phone numbers. Managers will have access to theiremployee’s data and project’s cost which can be used to make a better business decision. 2
  4. 4. Furthermore, mangers would be able to create and finalize reports of projects like theaverage 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 beaccessed via PortalPutTTY terminal emulator using SSH network protocol. The softwarethat would be used is Oracle 10g. Data definition language (DDL) would be used tocreate the database. Data manipulation language (DML) and Transaction controllanguage (TCL) would also be utilized to manipulate the database and make changes orundo transactions to the database.ToolsMicrosoft Visio 2010 and Oracle Data Modeler would be used to create the Entityrelationship diagram (ERD). Notepad +++ and notepad would be used to write and editSQL statements. Microsoft Project 2007 would be used to create the project schedule.Project SchedulePlease open the Microsoft Project file for complete project schedule attached with thisdocument. 3
  5. 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. 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_IDAssociated FK1 Emp_ID Address Apt_Num City H_State Job Phone_Home Phone_Mobile PK Job_Code Phone_Work Description 5
  7. 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. 8. Foreign Keys Name Object Descriptiondept_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. & Constraintassign_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. 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. 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. 11. RelationshipsRelationship 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. 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. 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_seqstart with 0400increment by 5Nocycle ;/* creates the job table */CREATE TABLE JOB( 12
  14. 14. Job_code Number, Description VARCHAR2(50) CONSTRAINT job_description_nn not null);/*end of statement*//* creates the primary key constraint*/Alter table jobadd 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 projectadd 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. 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 employeeadd constraint Emp_id_pk PRIMARY KEY(Emp_id);/* adds the null constraints to the columnn */Alter table employeemodify( 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) REFERENCESDEPARTMENT(Dept_ID) ;Alter table employee add CONSTRAINT Emp_job_code_fk FOREIGN KEY(Job_Code) REFERENCESJOB(Job_Code);/* sql ends */ 14
  16. 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) REFERENCESPROJECT(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. 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_seqstart with 05020increment by 12Nocycle/*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_seqstart with 030404increment by 130Nocycle ;/* create unique number for ssn*/create sequence emp_ssn_seqstart with 201342019increment by 1200Nocycle/* creates unique constraint for ssn*/ 16
  18. 18. Alter table employeeadd constraint emp_emp_ssn_uk unique (ssn);/* changed the sequence value*/Alter sequence emp_ssn_seqincrement by 498989Nocycle;/*ends*//* creates the unique sequence for pk column */Create sequence con_contact_id_seqstart with 00020increment by 123;nocycle;/* creates the unique number for project_num */create sequence proj_proj_num_seqstart with 0900increment by 5Nocycle/* end */ 17
  19. 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 departmentset 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 departmentset 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 departmentset dept_mgr_id = (select emp_id from employee where emp_id = 30534 ) 18
  20. 20. where dept_id = ( select dept_id from department where dept_id = 410);update departmentset 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 departmentset 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 departmentset 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 departmentset 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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 assignmentset assign_hours = 1200where ASSIGNMENT_NUM = 5824/*end sql*//*end*//* updates the cost for each employee based on their pay rate */update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num =5296 )where emp_id = 35214and Assignment_Num =5296 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num =5308 )where emp_id = 36384and Assignment_Num =5308 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num =5320)where emp_id = 34824and Assignment_Num =5320 ; 40
  42. 42. update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num =5344 )where emp_id = 34174and Assignment_Num =5344 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num =5356 )where emp_id = 34434and Assignment_Num =5356 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num =5368)where emp_id = 34044and Assignment_Num =5368 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num =5380)where emp_id =33784and Assignment_Num = 5380;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num =5392)where emp_id = 34304and Assignment_Num =5392 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num =5404)where emp_id = 32224and Assignment_Num =5404 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num =5416)where emp_id = 32484and Assignment_Num =5416 ; update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5428)where emp_id = 32744 41
  43. 43. and Assignment_Num = 5428 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5440)where emp_id = 30404and Assignment_Num = 5440 ; update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5452)where emp_id = 30924and Assignment_Num = 5452 ; update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5464)where emp_id = 31834and Assignment_Num = 5464;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5488)where emp_id = 35994and Assignment_Num = 5488;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5500)where emp_id = 35864and Assignment_Num = 5500;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5476 )where emp_id = 31444and Assignment_Num = 5476;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5512 )where emp_id = 36124and Assignment_Num = 5512; 42
  44. 44. update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5524 )where emp_id = 36254and Assignment_Num = 5524 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5536 )where emp_id = 33134and Assignment_Num = 5536;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5188 )where emp_id = 33394and Assignment_Num = 5188; update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5200 )where emp_id = 33264and Assignment_Num = 5200;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5212)where emp_id = 32224and Assignment_Num = 5212;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5224 )where emp_id = 32094and Assignment_Num = 5224 ; update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5236 )where emp_id = 32874and Assignment_Num = 5236;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5248 )where emp_id = 31704 43
  45. 45. and Assignment_Num = 5248;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5260 )where emp_id = 35994and Assignment_Num = 5260 ; update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5272)where emp_id = 36124and Assignment_Num = 5272;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5020)where emp_id = 34434and Assignment_Num = 5020;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5032 )where emp_id = 34304and Assignment_Num = 5032 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5044 )where emp_id = 33914and Assignment_Num = 5044 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5056 )where emp_id = 33784and Assignment_Num = 5056 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5068 )where emp_id = 34174and Assignment_Num = 5068;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5080)where emp_id = 34564and Assignment_Num = 5080 ; 44
  46. 46. update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5092 )where emp_id = 35084and Assignment_Num = 5092;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5104 )where emp_id = 34954and Assignment_Num = 5104 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5116 )where emp_id = 36514and Assignment_Num = 5116;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5128 )where emp_id = 36384and Assignment_Num = 5128 ; update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5140 )where emp_id = 30664and Assignment_Num = 5140 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5152)where emp_id = 30534and Assignment_Num = 5152;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5164 )where emp_id = 31054and Assignment_Num = 5164 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5176 )where emp_id = 31314and Assignment_Num = 5176; 45
  47. 47. update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 91608)where emp_id = 36254and Assignment_Num = 91608;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5284 )where emp_id = 36254and Assignment_Num = 5284 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5608 )where emp_id = 33654and Assignment_Num = 5608;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5620 )where emp_id = 33524and Assignment_Num = 5620;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5632)where emp_id = 32354and Assignment_Num = 5632 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5644 )where emp_id = 33004and Assignment_Num = 5644 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5656)where emp_id = 31184and Assignment_Num = 5656;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5680 )where emp_id = 30794and Assignment_Num = 5680; 46
  48. 48. update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5668)where emp_id = 32614and Assignment_Num = 5668 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5692 )where emp_id = 31964and Assignment_Num = 5692 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5704 )where emp_id = 31574and Assignment_Num = 5704 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5740 )where emp_id = 34694and Assignment_Num = 5740; update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5752)where emp_id = 35734and Assignment_Num = 5752 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5764 )where emp_id = 34434and Assignment_Num = 5764 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5776 )where emp_id = 32224and Assignment_Num = 5776; update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5788 )where emp_id = 30404and Assignment_Num = 5788 ;update assignment 47
  49. 49. set cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5812 )where emp_id = 31834and Assignment_Num = 5812 ;update assignmentset cost = (select e.emp_rate * a.assign_hours from employee e inner join assignment aon e.emp_id = a.emp_id where a.Assignment_Num = 5824)where emp_id = 34174and 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, CityHeights, 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 YorkCity, 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. 50. Database SnappshotThe log file could not be captured with a web browser. The following captured picturesreprsents the database state.Figure 1 described issued command describes table structure for Department, Project andEmployee. The describe isssued command in figure 2 describes the table structures forJob, Contact and Assiignment. 49
  51. 51. Figure 1 Table Structures 50
  52. 52. Figure 2 Table Structure 51
  53. 53. Figure 3 Contact Table Data 52
  54. 54. Figure 4 Department Table Data 53
  55. 55. Figure 5 Project Table Data 54
  56. 56. Figure 6 Employee Table Data 55
  57. 57. Figure 7 Employee Table Data 56
  58. 58. Figure 8 Assignment Table Data 57
  59. 59. Figure 9 Assignment Table Data 58
  60. 60. Figure 10 Assignment Table Data 59
  61. 61. Figure 11 Job Table Data 60
  62. 62. 61
  63. 63. Deliverable 5 - SQL Queries/* Show me name of employess whose job code is 65 */SELECT first_name, last_name, job_codefrom employeewhere 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_numberfrom employeeGroup 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. 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 employeewhere job_code= 65group 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_ratefrom employeewhereemp_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. 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_ratefrom employeewhere 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. 66. /* Show the list of the employees who are working on the project assigned in the past 6months */Select e.first_name,e.last_name , a.assign_date, assignment_numfrom employee e, assignment awheree.emp_id=a.emp_idandassign_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 descriptionwhose projects are overdue today */select emp_id, e.first_name, proj_name, p.due_datefrom employee e JOIN assignment ausing(emp_id)JOINproject pusing (proj_num)wheredue_date< sysdate 65
  67. 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. 68. Payment System34564 Addie New York Ticket Corp 09-SEP-10 34564 Payment System34824 Robert St Paul College Web System 02-FEB-11 34824 Development34954 Ray New York Ticket Corp 09-SEP-10 34954 Payment System35084 Zack New York Ticket Corp 09-SEP-10 35084 Payment System35214 Ashland St Paul College Web System 02-FEB-11 35214 Development35864 Jacob St Paul College Web System 02-FEB-11 35864 Development35994 Lee St Paul College Web System 02-FEB-11 35994 Development35994 Lee New York Ticket Corp 09-SEP-10 35994 Payment System36124 Rose St Paul College Web System 02-FEB-11 36124 Development36124 Rose New York Ticket Corp 09-SEP-10 36124 Payment System36254 Jackie St Paul College Web System 02-FEB-11 36254 Development36254 Jackie New York Ticket Corp 09-SEP-10 36254 Payment System36384 Derick St Paul College Web System 02-FEB-11 36384 Development36384 Derick New York Ticket Corp 09-SEP-10 36384 Payment System30404 Sunny St Paul College Web System 02-FEB-11 30404 Development30534 Mariah New York Ticket Corp 09-SEP-10 30534 Payment System 67
  69. 69. 30664 James New York Ticket Corp 09-SEP-10 30664 Payment System30924 Susan St Paul College Web System 02-FEB-11 30924 Development31054 Peter New York Ticket Corp 09-SEP-10 31054 Payment System31314 Fox New York Ticket Corp 09-SEP-10 31314 Payment System31444 Deng St Paul College Web System 02-FEB-11 31444 Development31704 Shirly New York Ticket Corp 09-SEP-10 31704 Payment System31834 Mathew St Paul College Web System 02-FEB-11 31834 Development32094 Donna New York Ticket Corp 09-SEP-10 32094 Payment System32224 Linda St Paul College Web System 02-FEB-11 32224 Development32224 Linda New York Ticket Corp 09-SEP-10 32224 Payment System32484 Kevin St Paul College Web System 02-FEB-11 32484 Development36514 Lou New York Ticket Corp 09-SEP-10 36514 Payment System Table 14 68

×