![Computer Networking: A Top-Down Approach (7th Edition)](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY';
/* JOB TABLE */
CREATE TABLE JOB (
JOB_CODE varchar2(3) PRIMARY KEY,
JOB_DESCRIPTION varchar2(25),
JOB_CHG_HOUR float(8),
JOB_LAST_UPDATE date
);
INSERT INTO JOB VALUES('500','Programmer', '35.75','11/20/2015');
INSERT INTO JOB VALUES('501','Systems Analyst', '96.75','11/20/2015');
INSERT INTO JOB VALUES('502','Database Designer', '125', '3/24/2016');
INSERT INTO JOB VALUES('503','Electrical Engineer', '84.5', '11/20/2015');
INSERT INTO JOB VALUES('504','Mechanical Engineer', '67.9', '11/20/2015');
INSERT INTO JOB VALUES('505','Civil Engineer', '55.78','11/20/2015');
INSERT INTO JOB VALUES('506','Clerical Support', '26.87','11/20/2016');
INSERT INTO JOB VALUES('507','DSS Analyst', '45.95','11/20/2015');
INSERT INTO JOB VALUES('508','Applications Designer','48.1', '3/24/2016');
INSERT INTO JOB VALUES('509','Bio Technician', '34.55','11/20/2015');
INSERT INTO JOB VALUES('510','General Support', '18.36','11/20/2015');
/* EMPLOYEE TABLE */
CREATE TABLE EMPLOYEE (
EMP_NUM varchar2(3) PRIMARY KEY,
EMP_LNAME varchar2(15),
EMP_FNAME varchar2(15),
EMP_INITIAL varchar2(1),
EMP_HIREDATE date,
JOB_CODE varchar2(3),
EMP_YEARS integer,
FOREIGN KEY (JOB_CODE) REFERENCES JOB
);
INSERT INTO EMPLOYEE VALUES('101','News','John','G','11/8/2000','502','4');
INSERT INTO EMPLOYEE VALUES('102','Senior','David','H','7/12/1989','501','15');
INSERT INTO EMPLOYEE VALUES('103','Arbough','June','E','12/1/1996','503','8');
INSERT INTO EMPLOYEE VALUES('104','Ramoras','Anne','K','11/15/1987','501','17');
INSERT INTO EMPLOYEE VALUES('105','Johnson','Alice','K','2/1/1993','502','12');
INSERT INTO EMPLOYEE VALUES('106','Smithfield','William','','6/22/2004','500','0');
INSERT INTO EMPLOYEE VALUES('107','Alonzo','Maria','D','10/10/1993','500','11');
INSERT INTO EMPLOYEE VALUES('108','Washington','Ralph','B','8/22/1991','501','13');
INSERT INTO EMPLOYEE VALUES('109','Smith','Larry','W','7/18/1997','501','7');
INSERT INTO EMPLOYEE VALUES('110','Olenko','Gerald','A','12/11/1995','505','9');
INSERT INTO EMPLOYEE VALUES('111','Wabash','Geoff','B','4/4/1991','506','14');
INSERT INTO EMPLOYEE VALUES('112','Smithson','Darlene','M','10/23/1994','507','10');
INSERT INTO EMPLOYEE VALUES('113','Joenbrood','Delbert','K','11/15/1996','508','8');
INSERT INTO EMPLOYEE VALUES('114','Jones','Annelise','','8/20/1993','508','11');
INSERT INTO EMPLOYEE VALUES('115','Bawangi','Travis','B','1/25/1992','501','13');
INSERT INTO EMPLOYEE VALUES('116','Pratt','Gerald','L','3/5/1997','510','8');
INSERT INTO EMPLOYEE VALUES('117','Williamson','Angie','H','6/19/1996','509','8');
INSERT INTO EMPLOYEE VALUES('118','Frommer','James','J','1/4/2005','510','0');
/* PROJECT TABLE */
CREATE TABLE PROJECT (
PROJ_NUM varchar2(3)PRIMARY KEY,
PROJ_NAME varchar2(25),
PROJ_VALUE float(8),
PROJ_BALANCE float(8),
EMP_NUM varchar2(3),
FOREIGN KEY (EMP_NUM) REFERENCES EMPLOYEE
);
INSERT INTO PROJECT VALUES('15','Evergreen','1453500','1002350','103');
INSERT INTO PROJECT VALUES('18','Amber Wave','3500500','2110346','108');
INSERT INTO PROJECT VALUES('22','Rolling Tide','805000','500345.2','102');
INSERT INTO PROJECT VALUES('25','Starflight','2650500','2309880','107');
/* ASSIGNMENT TABLE */
CREATE TABLE ASSIGNMENT (
ASSIGN_NUM integer PRIMARY KEY,
ASSIGN_DATE date,
PROJ_NUM varchar2(3),
EMP_NUM varchar2(3),
ASSIGN_JOB varchar2(3),
ASSIGN_CHG_HR float(8),
ASSIGN_HOURS float(8),
ASSIGN_CHARGE float(8),
FOREIGN KEY (PROJ_NUM) REFERENCES PROJECT,
FOREIGN KEY (EMP_NUM) REFERENCES EMPLOYEE,
FOREIGN KEY (ASSIGN_JOB) REFERENCES JOB (JOB_CODE)
);
INSERT INTO ASSIGNMENT VALUES('1001','3/22/2016','18','103','503','84.5','3.5','295.75');
INSERT INTO ASSIGNMENT VALUES('1002','3/22/2016','22','117','509','34.55','4.2','145.11');
INSERT INTO ASSIGNMENT VALUES('1003','3/22/2016','18','117','509','34.55','2','69.10');
INSERT INTO ASSIGNMENT VALUES('1004','3/22/2016','18','103','503','84.5','5.9','498.55');
INSERT INTO ASSIGNMENT VALUES('1005','3/22/2016','25','108','501','96.75','2.2','212.85');
INSERT INTO ASSIGNMENT VALUES('1006','3/22/2016','22','104','501','96.75','4.2','406.35');
INSERT INTO ASSIGNMENT VALUES('1007','3/22/2016','25','113','508','50.75','3.8','192.85');
INSERT INTO ASSIGNMENT VALUES('1008','3/22/2016','18','103','503','84.5','0.9','76.05');
INSERT INTO ASSIGNMENT VALUES('1009','3/23/2016','15','115','501','96.75','5.6','541.80');
INSERT INTO ASSIGNMENT VALUES('1010','3/23/2016','15','117','509','34.55','2.4','82.92');
INSERT INTO ASSIGNMENT VALUES('1011','3/23/2016','25','105','502','105','4.3','451.5');
INSERT INTO ASSIGNMENT VALUES('1012','3/23/2016','18','108','501','96.75','3.4','328.95');
INSERT INTO ASSIGNMENT VALUES('1013','3/23/2016','25','115','501','96.75','2','193.5');
INSERT INTO ASSIGNMENT VALUES('1014','3/23/2016','22','104','501','96.75','2.8','270.9');
INSERT INTO ASSIGNMENT VALUES('1015','3/23/2016','15','103','503','84.5','6.1','515.45');
INSERT INTO ASSIGNMENT VALUES('1016','3/23/2016','22','105','502','105','4.7','493.5');
INSERT INTO ASSIGNMENT VALUES('1017','3/23/2016','18','117','509','34.55','3.8','131.29');
INSERT INTO ASSIGNMENT VALUES('1018','3/23/2016','25','117','509','34.55','2.2','76.01');
INSERT INTO ASSIGNMENT VALUES('1019','3/24/2016','25','104','501','110.5','4.9','541.45');
INSERT INTO ASSIGNMENT VALUES('1020','3/24/2016','15','101','502','125','3.1','387.5');
INSERT INTO ASSIGNMENT VALUES('1021','3/24/2016','22','108','501','110.5','2.7','298.35');
INSERT INTO ASSIGNMENT VALUES('1022','3/24/2016','22','115','501','110.5','4.9','541.45');
INSERT INTO ASSIGNMENT VALUES('1023','3/24/2016','22','105','502','125','3.5','437.5');
INSERT INTO ASSIGNMENT VALUES('1024','3/24/2016','15','103','503','84.5','3.3','278.85');
INSERT INTO ASSIGNMENT VALUES('1025','3/24/2016','18','117','509','34.55','4.2','145.11');
![2. Create a package body named EMP_PS with function named findEmployeeByID which
takes employee number as input parameter and returns a string (see the output below).
When the employee number does not found in the table then it must return a message as
"The Employee Number Does Not Exist'.
Hint: Use EXCEPTION block in your function code.
SOLUTION:
(as ll NI) a;
W
40°C](https://content.bartleby.com/qna-images/question/7eadca08-8b27-4f68-be3c-ddab704928af/e0709950-5423-4aa8-86f8-81a2eca20544/x0sfyfb_thumbnail.jpeg)
Transcribed Image Text:2. Create a package body named EMP_PS with function named findEmployeeByID which
takes employee number as input parameter and returns a string (see the output below).
When the employee number does not found in the table then it must return a message as
"The Employee Number Does Not Exist'.
Hint: Use EXCEPTION block in your function code.
SOLUTION:
(as ll NI) a;
W
40°C
Expert Solution
![Check Mark](/static/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps
![Blurred answer](/static/blurred-answer.jpg)
Knowledge Booster
Similar questions
- ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY'; /* JOB TABLE */ CREATE TABLE JOB ( JOB_CODE varchar2(3) PRIMARY KEY, JOB_DESCRIPTION varchar2(25), JOB_CHG_HOUR float(8), JOB_LAST_UPDATE date ); INSERT INTO JOB VALUES('500','Programmer', '35.75','11/20/2015'); INSERT INTO JOB VALUES('501','Systems Analyst', '96.75','11/20/2015'); INSERT INTO JOB VALUES('502','Database Designer', '125', '3/24/2016'); INSERT INTO JOB VALUES('503','Electrical Engineer', '84.5', '11/20/2015'); INSERT INTO JOB VALUES('504','Mechanical Engineer', '67.9', '11/20/2015'); INSERT INTO JOB VALUES('505','Civil Engineer', '55.78','11/20/2015'); INSERT INTO JOB VALUES('506','Clerical Support', '26.87','11/20/2016'); INSERT INTO JOB VALUES('507','DSS Analyst', '45.95','11/20/2015'); INSERT INTO JOB VALUES('508','Applications Designer','48.1', '3/24/2016'); INSERT INTO JOB VALUES('509','Bio Technician', '34.55','11/20/2015'); INSERT INTO JOB…arrow_forwardTask 2: The Car Maintenance team also wants to store the actual maintenance operations in the database. The team wants to start with a table to store CAR_ID (CHAR(5)), MAINTENANCE_TYPE_ID (CHAR(5)) and MAINTENANCE_DUE (DATE) date for the operation. Create a new table named MAINTENANCES. The PRIMARY_KEY should be the combination of the three fields. The CAR_ID and MAINTENANCE_TYPE_ID should be foreign keys to their original tables. Cascade update and cascade delete the foreign keys. Create a new table to store maintenance operations Test Query DESCRIBE MAINTENANCES Expected Results Field Type Null Key Default Extra CAR_ID char(5) NO PRI NULL MAINTENANCE_TYPE_ID char(5) NO PRI NULL MAINTENANCE_DUE date NO PRI NULLarrow_forwardpart A Attempt to violate the primary key constraint and observe the result. part B Attempt to violate the foreign key constraint and observe the resultarrow_forward
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
![Text book image](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
![Text book image](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
![Text book image](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY