Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write this in PL/SQL so either one will work. Problems: 1. (PL/SQL Programming) Consider the table EMPLOYEE with attributes ID, Name, and Hours, and the
Write this in PL/SQL so either one will work.
Problems: 1. (PL/SQL Programming) Consider the table EMPLOYEE with attributes ID, Name, and Hours, and the table PAYINFO with attributes Regular, Overtime, and Cutoff, defined and populated by the following script DROP TABLE EMPLOYEE CASCADE CONSTRAINTS CREATE TABLE EMPLOYEE ID Name Hours CHAR (9), VARCHAR2 (12) NUMBER (3), CONSTRAINT PK EMPLOYEE PRIMARY KEY (ID) INSERT INTO EMPLOYEE VALUES '717222144', 'Dolenz, 30); INSERT INTO EMPLOYEE VALUES '013331902", 'Jones', 50); INSERT INTO EMPLOYEE VALUES ('591342771', 'Nesmith', 65); INSERT INTO EMPLOYEE VALUES (' 822182889*, 'Tork, 25); SELECT * FROM EMPLOYEE DROP TABLE PAYINFO; CREATE TABLE PAYINFO Regular Overtime Cutoff NUMBER (4,2), NUMBER (4,2), NUMBER (2) INSERT INTO PAYINFO VALUES (15.00, 18.50, 40); SELECTFROM PAYINFO; COMMIT Write a script file Problem1.sql containing an anonymous PL/SQL block that will do the followin First, report three values found in the PAYINFO table and store them in variables. (You may assume that the PAYINFO table contains only one record.) Next, output the ID and Name of each employee in the EMPLOYEE table and their total pay, computed as Regular* Hours (Regular* Cutoff) +(Overtime * (Hours - Cutoff)) if Hours Cutoff (In other words, each employee is paid at the regular hourly rate for hours up to the cutoff value, and is paid at the higher overtime rate for any hours beyond the cutoff value.) Output each Problems: 1. (PL/SQL Programming) Consider the table EMPLOYEE with attributes ID, Name, and Hours, and the table PAYINFO with attributes Regular, Overtime, and Cutoff, defined and populated by the following script DROP TABLE EMPLOYEE CASCADE CONSTRAINTS CREATE TABLE EMPLOYEE ID Name Hours CHAR (9), VARCHAR2 (12) NUMBER (3), CONSTRAINT PK EMPLOYEE PRIMARY KEY (ID) INSERT INTO EMPLOYEE VALUES '717222144', 'Dolenz, 30); INSERT INTO EMPLOYEE VALUES '013331902", 'Jones', 50); INSERT INTO EMPLOYEE VALUES ('591342771', 'Nesmith', 65); INSERT INTO EMPLOYEE VALUES (' 822182889*, 'Tork, 25); SELECT * FROM EMPLOYEE DROP TABLE PAYINFO; CREATE TABLE PAYINFO Regular Overtime Cutoff NUMBER (4,2), NUMBER (4,2), NUMBER (2) INSERT INTO PAYINFO VALUES (15.00, 18.50, 40); SELECTFROM PAYINFO; COMMIT Write a script file Problem1.sql containing an anonymous PL/SQL block that will do the followin First, report three values found in the PAYINFO table and store them in variables. (You may assume that the PAYINFO table contains only one record.) Next, output the ID and Name of each employee in the EMPLOYEE table and their total pay, computed as Regular* Hours (Regular* Cutoff) +(Overtime * (Hours - Cutoff)) if Hours Cutoff (In other words, each employee is paid at the regular hourly rate for hours up to the cutoff value, and is paid at the higher overtime rate for any hours beyond the cutoff value.) Output eachStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started