SlideShare a Scribd company logo
1 of 16
MSCD650 Final Exam feedback Form
MSCD650 Final Exam Grading Form
(Instructions follow the form)
Coding
55 Percent
Points Earned
Comments:
Trigger Code:
· Code meets requirements
· Code compiles cleanly
/15
Pre-Calculation Procedure Code
· Code meets requirements
· Code compiles cleanly
/15
PL/SQL Block Code
· Code meets requirements
· Code compiles cleanly
/15
Function Code
· Code meets requirements
· Code compiles cleanly
/10
/55
Unit Testing
35 Percent
Points Earned
Comments:
Unit Test for Trigger Code:
· All conditions are thoroughly tested
· The code runs successfully
· All data to prove test worked is displayed
/10
Unit Test for Procedure Code:
· All conditions are thoroughly tested
· The code runs successfully
· All data to prove test worked is displayed
· The tester can easily follow the path of the execution.
/10
.
Unit Test for PL/SQL Block Code:
· All conditions are thoroughly tested
· The code runs successfully
· All data to prove test worked is displayed
· The tester can easily follow the path of the execution.
/10
Unit Test for View/Function Code:
· All conditions are thoroughly tested
· The code runs successfully
· All data to prove test worked is displayed
· The tester can easily follow the path of the execution.
/5
/35
Documentation
10 Percent
Points Earned
Comments:
Presentation:
· The document is easy to read.
· The document is Professional in appearance
· It is easy for the reader to find what they are looking for.
/5
Documentation:
· Code is documented so that anyone who picks it up knows
what it is doing.
/5
/10
Total 100
Percent
Points Earned
Comments:
Case Study
Overview of assignment
As a new ABC Consultant assigned to the XYZ Company, you
have been asked to enhance the current system to include
payroll processing. Although the current employee table has
monthly salary and commission columns, it does not provide
any means for storing employee deductions. You will add the
tables necessary to store employee deductions. Next you will
create a payroll pre-calculation program that will calculate the
net pay for all the employees via a batch process (a stored
procedure in a package, which will call other stored procedures
within the package). Although this is not a complete payroll
system, the unit test results must be accurate.
Next you will create two PL/SQL blocks for inserting and
deleting rows from the employee deduction table. These
PL/SQL blocks will be passed information from host or bind
variables and a third PL/SQL block which will assign the
variables defined in SQL*Plus (e.g. employee number, dollar
amount and deduction name). Since the XYZ Company wants to
track changes to the employee and employee deduction tables,
you will create two database triggers that will update audit
tables when rows are changed or deleted.
The XYZ Company also requires a view that will display
specific employee information, plus the number of deductions
for an employee. This will be accomplished by creating a
stored function that will count the number for deductions for an
employee. This function will be invoked in the select statement
for the employee view.
Task List
Setup
· Create the tables in the existing system. Data for these tables
can be found in the appendix for this document. If you wish you
may add addition rows to these tables.
CREATE TABLE dept (
deptno Number(2) Primary Key,
dname VARCHAR2(14),
loc VARCHAR2(13));
Create table emp (
empno NUMBER(4) Primary Key,
ename VARCHAR2(10),
job VARCHAR2(9),
mgr NUMBER(4),
hiredate DATE,
sal NUMBER(7,2),
comm NUMBER(7,2),
deptno NUMBER(2));
Create table salgrade (
grade NUMBER,
losal NUMBER,
hisal NUMBER);
· Create a table for deductions with three columns: deduction
name (PK), Salary grade minimum, salary grade maximum. You
need to populate the deduction table any way you wish.
Populate the table with as many deductions as you think would
be appropriate to thoroughly test your application. The salgrade
min and max information will come from the salgrade table.
CREATE TABLE deductions (
name VARCHAR2(30),
salary_grade_min NUMBER(2),
salary_grade_max NUMBER(2));
· Create a table for employee deductions with a foreign key
(name) to the deduction table, a flag that indicates if the
deduction is a before tax or after tax deduction, deduction
(dollar) amount and another foreign key (empno) to the
employee table. This table is an intersection table and the two
foreign keys concatenated together will be the primary key of
this table.
CREATE TABLE emp_deductions (
fk_deduction
VARCHAR2(30),
fk_empno
NUMBER(4),
before_or_after_flag
CHAR(1),
deduction_amount
NUMBER(6,2));
· Create two audit tables, one for the employee table and one for
the employee deduction table. These audit tables should
contain a unique numeric ID (assigned via a sequence), the
current date, and the user id of the person that has made the
change to he employee or employee deduction table, and all the
columns from the source table.
CREATE TABLE emp_audit (
audit_uid
NUMBER(15),
change_date
DATE,
change_user
VARCHAR2(30),
action
CHAR(1),
empno
NUMBER(4),
ename VARCHAR2(10),
job
VARCHAR2(9),
mgr
NUMBER(4),
hiredate
DATE,
sal
NUMBER(7,2),
comm
NUMBER(7,2),
deptno
NUMBER(2));
CREATE TABLE emp_deductions_audit (
audit_uid
NUMBER(15),
change_date
DATE,
change_user
VARCHAR2(30),
action
CHAR(1),
fk_deduction
VARCHAR2(30),
fk_empno
NUMBER(4),
before_or_after_flag
CHAR(1),
deduction_amount
NUMBER(6,2));
· Create two sequences that will be used to populate the audit
tables with a unique identifier.
· Create a table to keep tax rates, these can be real or bogus, as
long as there are at least 7 different rates ( For example, if the
annual salary is 0 -10000 then a 5% tax rate, 10001 – 20000
then a 7% tax rate, etc)
CREATE TABLE tax_rates (
percent
NUMBER(3,2),
salary_min
NUMBER(8,2),
salary_max
NUMBER(8,2));
Program Description
· Create two PL/SQL blocks that will insert or delete rows from
the employee deduction table. Include exception processing for
bad input data and verify that an employee is eligible for a
deduction based upon their salary grade. Salary grade is
determined by checking the salary grade table to derive the
employee’s salary grade. Once you know an employee’s grade,
then verify if the employee is eligible for the deduction (e.g.
401K) via comparing it to the minimum and maximum salary
grade that is stored in the deduction table ( see definition
above).
· Create two database triggers that will update the employee
audit table and employee deduction audit table when rows are
either changed or deleted. Use a sequence number to assign a
unique identifier to each row as it is created in the audit table.
Capture the user ID, date of the change or delete, and action
(update or delete), plus all the fields in the before image of the
row (e.g. before it is changed or deleted).
· Create a function that will count the number of deductions for
an employee. Input to the function is the employee ID and it
returns the count of employee deductions. If there aren’t any
deductions for the employee, the function returns zero. Within
the view, include the employee name, number, hire date, job,
dept number and the umber of deductions for the employee. Use
the naming standard <name>_v.
CREATE or REPLACE VIEW show_deduction_v AS
SELECT empno,
ename,
hiredate,
deptno,
job,
count_deductions(empno) deduction_cnt
FROM emp;
· Create a package that contains multiple stored procedures.
Only one procedure will be available to external calls (in the
package specifications). The other procedure will be
subroutines that are called by the main procedure in the package
body. It is okay to include stored functions in your package
that support the procedure. The procedure will accomplish the
following steps for each employee:
· Subtract the before tax deductions from the monthly salary.
· Calculate and subtract Federal Tax and State Income using the
tax table that you created (see above). For more of a challenge,
initially load the tax table into a PL/SQL table that resides in
memory (optional). Use the same rate for Federal Income Tax
(FIT) and State Income Tax (SIT).
· Exclude other taxes (e.g. SS)
· Include commission as part of the salary
· Subtract after tax deductions from the remaining monthly
salary to determine the net pay.
· Use DBMS_OUTPUT to display all deductions/calculations
and net pay. This will enable you to turn spool on and capture
all the calculations for all employees when you execute the
procedure via SQL*Plus.
Deliverables
· Listing of code for every block (function, trigger, a package
with procedures, etc.) defined above.
· Unit test data for every block defined above (use the spool
command).
Note: I’ll check test results from the pre-calc program with a
calculator. The net pay amount must be correct for full credit.
Include test data dumps of every table so that I can verify your
test results.
· MAKE A LIST OF DELIVERABLES AND CHECK IT
TWICE. IF YOU LEAVE OUT A PIECE OF CODE OR UNIT
TEST DATA, YOU WILL NOT RECEIVE FULL CREDIT.
Appendix
Insert into dept
values (10, 'ACCOUNTING', 'NEW YORK');
Insert into dept
values (20, 'RESEARCH', 'DALLAS');
Insert into dept
values (30, 'SALES', 'CHICAGO');
Insert into dept
values (40, 'OPERATIONS','BOSTON');
insert into emp
values (7369, 'SMITH', 'CLERK', 7902, '17-DEC-80',
800,NULL,20);
insert into emp
values (7499, 'ALLEN', 'SALESMAN', 7698, '20-FEB-81',
1600, 300, 30);
insert into emp
values (7521, 'WARD', 'SALESMAN', 7698, '22-FEB-81',
1250, 500, 30);
Insert into emp
values (7566, 'JONES', 'MANAGER', 7839, '02-APR-81',
2975,NULL, 20);
Insert into emp
values (7654, 'MARTIN', 'SALESMAN', 7698, '28-SEP-81',
1250, 1400, 30);
Insert into emp
values (7698, 'BLAKE', 'MANAGER', 7839, '01-MAY-81',
2850,NULL, 30);
Insert into emp
values (7782, 'CLARK', 'MANAGER', 7839, '09-JUN-81',
2450, NULL, 10);
Insert into emp
values (7788, 'SCOTT', 'ANALYST', 7566, '19-APR-87',
3000,NULL, 20);
Insert into emp
values (7839, 'KING', 'PRESIDENT',NULL , '17-NOV-81',
5000,NULL, 10);
Insert into emp
values (7844, 'TURNER', 'SALESMAN', 7698, '08-SEP-
81',1500,0, 30);
Insert into emp
values (7876, 'ADAMS', 'CLERK', 7788, '23-MAY-
87',1100,NULL, 20);
Insert into emp
values (7900, 'JAMES', 'CLERK', 7698, '03-DEC-81',
950,NULL, 30);
Insert into emp
values (7902, 'FORD', 'ANALYST', 7566, '03-DEC-
81',3000,NULL, 20);
Insert into emp
values (7934, 'MILLER', 'CLERK', 7782, '23-JAN-82',1300,
NULL, 10);
Insert into salgrade
values(1, 700, 1200);
Insert into salgrade
values (2, 1201, 1400);
Insert into salgrade
values (3, 1401, 2000);
Insert into salgrade
values (4, 2001, 3000);
Insert into salgrade
values (5, 3001, 9999);
commit;
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx

More Related Content

Similar to MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx

Plsql task
Plsql taskPlsql task
Plsql taskNawaz Sk
 
Portfolio For Charles Tontz
Portfolio For Charles TontzPortfolio For Charles Tontz
Portfolio For Charles Tontzctontz
 
Oracle OCP 1Z0-007题库
Oracle OCP 1Z0-007题库Oracle OCP 1Z0-007题库
Oracle OCP 1Z0-007题库renguzi
 
William Schaffrans Bus Intelligence Portfolio
William Schaffrans Bus Intelligence PortfolioWilliam Schaffrans Bus Intelligence Portfolio
William Schaffrans Bus Intelligence Portfoliowschaffr
 
The ultimate-guide-to-sql
The ultimate-guide-to-sqlThe ultimate-guide-to-sql
The ultimate-guide-to-sqlMcNamaraChiwaye
 
Aggregate Functions,Final
Aggregate Functions,FinalAggregate Functions,Final
Aggregate Functions,Finalmukesh24pandey
 
12c SQL Plan Directives
12c SQL Plan Directives12c SQL Plan Directives
12c SQL Plan DirectivesFranck Pachot
 
Data Exploration with Apache Drill: Day 2
Data Exploration with Apache Drill: Day 2Data Exploration with Apache Drill: Day 2
Data Exploration with Apache Drill: Day 2Charles Givre
 
How to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureHow to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureOdoo
 
Oracle - Program with PL/SQL - Lession 16
Oracle - Program with PL/SQL - Lession 16Oracle - Program with PL/SQL - Lession 16
Oracle - Program with PL/SQL - Lession 16Thuan Nguyen
 
Simplifying SQL with CTE's and windowing functions
Simplifying SQL with CTE's and windowing functionsSimplifying SQL with CTE's and windowing functions
Simplifying SQL with CTE's and windowing functionsClayton Groom
 
Oracle tips and tricks
Oracle tips and tricksOracle tips and tricks
Oracle tips and tricksYanli Liu
 
Oracle - Program with PL/SQL - Lession 17
Oracle - Program with PL/SQL - Lession 17Oracle - Program with PL/SQL - Lession 17
Oracle - Program with PL/SQL - Lession 17Thuan Nguyen
 

Similar to MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx (20)

Plsql task
Plsql taskPlsql task
Plsql task
 
Portfolio For Charles Tontz
Portfolio For Charles TontzPortfolio For Charles Tontz
Portfolio For Charles Tontz
 
Oracle OCP 1Z0-007题库
Oracle OCP 1Z0-007题库Oracle OCP 1Z0-007题库
Oracle OCP 1Z0-007题库
 
Dump Answers
Dump AnswersDump Answers
Dump Answers
 
William Schaffrans Bus Intelligence Portfolio
William Schaffrans Bus Intelligence PortfolioWilliam Schaffrans Bus Intelligence Portfolio
William Schaffrans Bus Intelligence Portfolio
 
6
66
6
 
The ultimate-guide-to-sql
The ultimate-guide-to-sqlThe ultimate-guide-to-sql
The ultimate-guide-to-sql
 
Aggregate Functions,Final
Aggregate Functions,FinalAggregate Functions,Final
Aggregate Functions,Final
 
12c SQL Plan Directives
12c SQL Plan Directives12c SQL Plan Directives
12c SQL Plan Directives
 
Chapter5.ppt
Chapter5.pptChapter5.ppt
Chapter5.ppt
 
Data Exploration with Apache Drill: Day 2
Data Exploration with Apache Drill: Day 2Data Exploration with Apache Drill: Day 2
Data Exploration with Apache Drill: Day 2
 
How to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureHow to Create a l10n Payroll Structure
How to Create a l10n Payroll Structure
 
Oracle - Program with PL/SQL - Lession 16
Oracle - Program with PL/SQL - Lession 16Oracle - Program with PL/SQL - Lession 16
Oracle - Program with PL/SQL - Lession 16
 
CONTROL STRUCTURE
CONTROL STRUCTURECONTROL STRUCTURE
CONTROL STRUCTURE
 
Simplifying SQL with CTE's and windowing functions
Simplifying SQL with CTE's and windowing functionsSimplifying SQL with CTE's and windowing functions
Simplifying SQL with CTE's and windowing functions
 
Oracle tips and tricks
Oracle tips and tricksOracle tips and tricks
Oracle tips and tricks
 
PL/SQL TRIGGERS
PL/SQL TRIGGERSPL/SQL TRIGGERS
PL/SQL TRIGGERS
 
Skillwise JCL
Skillwise JCLSkillwise JCL
Skillwise JCL
 
4sem dbms(1)
4sem dbms(1)4sem dbms(1)
4sem dbms(1)
 
Oracle - Program with PL/SQL - Lession 17
Oracle - Program with PL/SQL - Lession 17Oracle - Program with PL/SQL - Lession 17
Oracle - Program with PL/SQL - Lession 17
 

More from gilpinleeanna

Name 1. The table shows the number of days per week, x, that 100.docx
Name 1. The table shows the number of days per week, x, that 100.docxName 1. The table shows the number of days per week, x, that 100.docx
Name 1. The table shows the number of days per week, x, that 100.docxgilpinleeanna
 
Name _____________________Date ________________________ESL.docx
Name  _____________________Date  ________________________ESL.docxName  _____________________Date  ________________________ESL.docx
Name _____________________Date ________________________ESL.docxgilpinleeanna
 
Name Bijapur Fort Year 1599 Location Bijapur city.docx
Name Bijapur Fort Year 1599 Location Bijapur city.docxName Bijapur Fort Year 1599 Location Bijapur city.docx
Name Bijapur Fort Year 1599 Location Bijapur city.docxgilpinleeanna
 
Name _______________________________ (Ex2 rework) CHM 33.docx
Name  _______________________________ (Ex2 rework) CHM 33.docxName  _______________________________ (Ex2 rework) CHM 33.docx
Name _______________________________ (Ex2 rework) CHM 33.docxgilpinleeanna
 
Name 1 Should Transportation Security Officers Be A.docx
Name 1 Should Transportation Security Officers Be A.docxName 1 Should Transportation Security Officers Be A.docx
Name 1 Should Transportation Security Officers Be A.docxgilpinleeanna
 
Name Don’t ForgetDate UNIT 3 TEST(The direct.docx
Name   Don’t ForgetDate       UNIT 3 TEST(The direct.docxName   Don’t ForgetDate       UNIT 3 TEST(The direct.docx
Name Don’t ForgetDate UNIT 3 TEST(The direct.docxgilpinleeanna
 
Name Add name hereConcept Matching From Disease to Treatmen.docx
Name  Add name hereConcept Matching From Disease to Treatmen.docxName  Add name hereConcept Matching From Disease to Treatmen.docx
Name Add name hereConcept Matching From Disease to Treatmen.docxgilpinleeanna
 
Name Abdulla AlsuwaidiITA 160Uncle VanyaMan has been en.docx
Name Abdulla AlsuwaidiITA 160Uncle VanyaMan has been en.docxName Abdulla AlsuwaidiITA 160Uncle VanyaMan has been en.docx
Name Abdulla AlsuwaidiITA 160Uncle VanyaMan has been en.docxgilpinleeanna
 
Name Add name hereHIM 2214 Module 6 Medical Record Abstractin.docx
Name  Add name hereHIM 2214 Module 6 Medical Record Abstractin.docxName  Add name hereHIM 2214 Module 6 Medical Record Abstractin.docx
Name Add name hereHIM 2214 Module 6 Medical Record Abstractin.docxgilpinleeanna
 
Name Sophocles, AntigoneMain Characters Antigone, Cre.docx
Name    Sophocles, AntigoneMain Characters Antigone, Cre.docxName    Sophocles, AntigoneMain Characters Antigone, Cre.docx
Name Sophocles, AntigoneMain Characters Antigone, Cre.docxgilpinleeanna
 
N4455 Nursing Leadership and ManagementWeek 3 Assignment 1.docx
N4455 Nursing Leadership and ManagementWeek 3 Assignment 1.docxN4455 Nursing Leadership and ManagementWeek 3 Assignment 1.docx
N4455 Nursing Leadership and ManagementWeek 3 Assignment 1.docxgilpinleeanna
 
Name Habitable Zones – Student GuideExercisesPlease r.docx
Name  Habitable Zones – Student GuideExercisesPlease r.docxName  Habitable Zones – Student GuideExercisesPlease r.docx
Name Habitable Zones – Student GuideExercisesPlease r.docxgilpinleeanna
 
Name Class Date SKILL ACTIVITY Giving an Eff.docx
Name    Class    Date   SKILL ACTIVITY Giving an Eff.docxName    Class    Date   SKILL ACTIVITY Giving an Eff.docx
Name Class Date SKILL ACTIVITY Giving an Eff.docxgilpinleeanna
 
Name Speech Title I. Intro A) Atten.docx
Name  Speech Title    I. Intro  A) Atten.docxName  Speech Title    I. Intro  A) Atten.docx
Name Speech Title I. Intro A) Atten.docxgilpinleeanna
 
n engl j med 352;16www.nejm.org april 21, .docx
n engl j med 352;16www.nejm.org april 21, .docxn engl j med 352;16www.nejm.org april 21, .docx
n engl j med 352;16www.nejm.org april 21, .docxgilpinleeanna
 
Name Class Date HUMR 211 Spr.docx
Name     Class     Date    HUMR 211 Spr.docxName     Class     Date    HUMR 211 Spr.docx
Name Class Date HUMR 211 Spr.docxgilpinleeanna
 
NAME ----------------------------------- CLASS -------------- .docx
NAME ----------------------------------- CLASS -------------- .docxNAME ----------------------------------- CLASS -------------- .docx
NAME ----------------------------------- CLASS -------------- .docxgilpinleeanna
 
NAHQ Code of Ethics and Standards of Practice ©Copyright 2011 .docx
NAHQ Code of Ethics and Standards of Practice ©Copyright 2011 .docxNAHQ Code of Ethics and Standards of Practice ©Copyright 2011 .docx
NAHQ Code of Ethics and Standards of Practice ©Copyright 2011 .docxgilpinleeanna
 
Name Understanding by Design (UbD) TemplateStage 1—Desir.docx
Name  Understanding by Design (UbD) TemplateStage 1—Desir.docxName  Understanding by Design (UbD) TemplateStage 1—Desir.docx
Name Understanding by Design (UbD) TemplateStage 1—Desir.docxgilpinleeanna
 
Name MUS108 Music Cultures of the World .docx
Name              MUS108 Music Cultures of the World              .docxName              MUS108 Music Cultures of the World              .docx
Name MUS108 Music Cultures of the World .docxgilpinleeanna
 

More from gilpinleeanna (20)

Name 1. The table shows the number of days per week, x, that 100.docx
Name 1. The table shows the number of days per week, x, that 100.docxName 1. The table shows the number of days per week, x, that 100.docx
Name 1. The table shows the number of days per week, x, that 100.docx
 
Name _____________________Date ________________________ESL.docx
Name  _____________________Date  ________________________ESL.docxName  _____________________Date  ________________________ESL.docx
Name _____________________Date ________________________ESL.docx
 
Name Bijapur Fort Year 1599 Location Bijapur city.docx
Name Bijapur Fort Year 1599 Location Bijapur city.docxName Bijapur Fort Year 1599 Location Bijapur city.docx
Name Bijapur Fort Year 1599 Location Bijapur city.docx
 
Name _______________________________ (Ex2 rework) CHM 33.docx
Name  _______________________________ (Ex2 rework) CHM 33.docxName  _______________________________ (Ex2 rework) CHM 33.docx
Name _______________________________ (Ex2 rework) CHM 33.docx
 
Name 1 Should Transportation Security Officers Be A.docx
Name 1 Should Transportation Security Officers Be A.docxName 1 Should Transportation Security Officers Be A.docx
Name 1 Should Transportation Security Officers Be A.docx
 
Name Don’t ForgetDate UNIT 3 TEST(The direct.docx
Name   Don’t ForgetDate       UNIT 3 TEST(The direct.docxName   Don’t ForgetDate       UNIT 3 TEST(The direct.docx
Name Don’t ForgetDate UNIT 3 TEST(The direct.docx
 
Name Add name hereConcept Matching From Disease to Treatmen.docx
Name  Add name hereConcept Matching From Disease to Treatmen.docxName  Add name hereConcept Matching From Disease to Treatmen.docx
Name Add name hereConcept Matching From Disease to Treatmen.docx
 
Name Abdulla AlsuwaidiITA 160Uncle VanyaMan has been en.docx
Name Abdulla AlsuwaidiITA 160Uncle VanyaMan has been en.docxName Abdulla AlsuwaidiITA 160Uncle VanyaMan has been en.docx
Name Abdulla AlsuwaidiITA 160Uncle VanyaMan has been en.docx
 
Name Add name hereHIM 2214 Module 6 Medical Record Abstractin.docx
Name  Add name hereHIM 2214 Module 6 Medical Record Abstractin.docxName  Add name hereHIM 2214 Module 6 Medical Record Abstractin.docx
Name Add name hereHIM 2214 Module 6 Medical Record Abstractin.docx
 
Name Sophocles, AntigoneMain Characters Antigone, Cre.docx
Name    Sophocles, AntigoneMain Characters Antigone, Cre.docxName    Sophocles, AntigoneMain Characters Antigone, Cre.docx
Name Sophocles, AntigoneMain Characters Antigone, Cre.docx
 
N4455 Nursing Leadership and ManagementWeek 3 Assignment 1.docx
N4455 Nursing Leadership and ManagementWeek 3 Assignment 1.docxN4455 Nursing Leadership and ManagementWeek 3 Assignment 1.docx
N4455 Nursing Leadership and ManagementWeek 3 Assignment 1.docx
 
Name Habitable Zones – Student GuideExercisesPlease r.docx
Name  Habitable Zones – Student GuideExercisesPlease r.docxName  Habitable Zones – Student GuideExercisesPlease r.docx
Name Habitable Zones – Student GuideExercisesPlease r.docx
 
Name Class Date SKILL ACTIVITY Giving an Eff.docx
Name    Class    Date   SKILL ACTIVITY Giving an Eff.docxName    Class    Date   SKILL ACTIVITY Giving an Eff.docx
Name Class Date SKILL ACTIVITY Giving an Eff.docx
 
Name Speech Title I. Intro A) Atten.docx
Name  Speech Title    I. Intro  A) Atten.docxName  Speech Title    I. Intro  A) Atten.docx
Name Speech Title I. Intro A) Atten.docx
 
n engl j med 352;16www.nejm.org april 21, .docx
n engl j med 352;16www.nejm.org april 21, .docxn engl j med 352;16www.nejm.org april 21, .docx
n engl j med 352;16www.nejm.org april 21, .docx
 
Name Class Date HUMR 211 Spr.docx
Name     Class     Date    HUMR 211 Spr.docxName     Class     Date    HUMR 211 Spr.docx
Name Class Date HUMR 211 Spr.docx
 
NAME ----------------------------------- CLASS -------------- .docx
NAME ----------------------------------- CLASS -------------- .docxNAME ----------------------------------- CLASS -------------- .docx
NAME ----------------------------------- CLASS -------------- .docx
 
NAHQ Code of Ethics and Standards of Practice ©Copyright 2011 .docx
NAHQ Code of Ethics and Standards of Practice ©Copyright 2011 .docxNAHQ Code of Ethics and Standards of Practice ©Copyright 2011 .docx
NAHQ Code of Ethics and Standards of Practice ©Copyright 2011 .docx
 
Name Understanding by Design (UbD) TemplateStage 1—Desir.docx
Name  Understanding by Design (UbD) TemplateStage 1—Desir.docxName  Understanding by Design (UbD) TemplateStage 1—Desir.docx
Name Understanding by Design (UbD) TemplateStage 1—Desir.docx
 
Name MUS108 Music Cultures of the World .docx
Name              MUS108 Music Cultures of the World              .docxName              MUS108 Music Cultures of the World              .docx
Name MUS108 Music Cultures of the World .docx
 

Recently uploaded

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 

MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx

  • 1. MSCD650 Final Exam feedback Form MSCD650 Final Exam Grading Form (Instructions follow the form) Coding 55 Percent Points Earned Comments: Trigger Code: · Code meets requirements · Code compiles cleanly /15 Pre-Calculation Procedure Code · Code meets requirements · Code compiles cleanly /15 PL/SQL Block Code · Code meets requirements · Code compiles cleanly /15 Function Code · Code meets requirements · Code compiles cleanly /10 /55
  • 2. Unit Testing 35 Percent Points Earned Comments: Unit Test for Trigger Code: · All conditions are thoroughly tested · The code runs successfully · All data to prove test worked is displayed /10 Unit Test for Procedure Code: · All conditions are thoroughly tested · The code runs successfully · All data to prove test worked is displayed · The tester can easily follow the path of the execution. /10 . Unit Test for PL/SQL Block Code: · All conditions are thoroughly tested · The code runs successfully · All data to prove test worked is displayed · The tester can easily follow the path of the execution. /10 Unit Test for View/Function Code: · All conditions are thoroughly tested
  • 3. · The code runs successfully · All data to prove test worked is displayed · The tester can easily follow the path of the execution. /5 /35 Documentation 10 Percent Points Earned Comments: Presentation: · The document is easy to read. · The document is Professional in appearance · It is easy for the reader to find what they are looking for. /5 Documentation: · Code is documented so that anyone who picks it up knows what it is doing. /5 /10 Total 100 Percent Points Earned
  • 4. Comments: Case Study Overview of assignment As a new ABC Consultant assigned to the XYZ Company, you have been asked to enhance the current system to include payroll processing. Although the current employee table has monthly salary and commission columns, it does not provide any means for storing employee deductions. You will add the tables necessary to store employee deductions. Next you will create a payroll pre-calculation program that will calculate the net pay for all the employees via a batch process (a stored procedure in a package, which will call other stored procedures within the package). Although this is not a complete payroll system, the unit test results must be accurate. Next you will create two PL/SQL blocks for inserting and deleting rows from the employee deduction table. These PL/SQL blocks will be passed information from host or bind variables and a third PL/SQL block which will assign the variables defined in SQL*Plus (e.g. employee number, dollar amount and deduction name). Since the XYZ Company wants to track changes to the employee and employee deduction tables, you will create two database triggers that will update audit tables when rows are changed or deleted. The XYZ Company also requires a view that will display specific employee information, plus the number of deductions for an employee. This will be accomplished by creating a stored function that will count the number for deductions for an employee. This function will be invoked in the select statement for the employee view. Task List
  • 5. Setup · Create the tables in the existing system. Data for these tables can be found in the appendix for this document. If you wish you may add addition rows to these tables. CREATE TABLE dept ( deptno Number(2) Primary Key, dname VARCHAR2(14), loc VARCHAR2(13)); Create table emp ( empno NUMBER(4) Primary Key, ename VARCHAR2(10), job VARCHAR2(9), mgr NUMBER(4), hiredate DATE, sal NUMBER(7,2), comm NUMBER(7,2), deptno NUMBER(2)); Create table salgrade ( grade NUMBER,
  • 6. losal NUMBER, hisal NUMBER); · Create a table for deductions with three columns: deduction name (PK), Salary grade minimum, salary grade maximum. You need to populate the deduction table any way you wish. Populate the table with as many deductions as you think would be appropriate to thoroughly test your application. The salgrade min and max information will come from the salgrade table. CREATE TABLE deductions ( name VARCHAR2(30), salary_grade_min NUMBER(2), salary_grade_max NUMBER(2)); · Create a table for employee deductions with a foreign key (name) to the deduction table, a flag that indicates if the deduction is a before tax or after tax deduction, deduction (dollar) amount and another foreign key (empno) to the employee table. This table is an intersection table and the two foreign keys concatenated together will be the primary key of this table. CREATE TABLE emp_deductions ( fk_deduction VARCHAR2(30), fk_empno NUMBER(4),
  • 7. before_or_after_flag CHAR(1), deduction_amount NUMBER(6,2)); · Create two audit tables, one for the employee table and one for the employee deduction table. These audit tables should contain a unique numeric ID (assigned via a sequence), the current date, and the user id of the person that has made the change to he employee or employee deduction table, and all the columns from the source table. CREATE TABLE emp_audit ( audit_uid NUMBER(15), change_date DATE, change_user VARCHAR2(30), action CHAR(1), empno
  • 10. before_or_after_flag CHAR(1), deduction_amount NUMBER(6,2)); · Create two sequences that will be used to populate the audit tables with a unique identifier. · Create a table to keep tax rates, these can be real or bogus, as long as there are at least 7 different rates ( For example, if the annual salary is 0 -10000 then a 5% tax rate, 10001 – 20000 then a 7% tax rate, etc) CREATE TABLE tax_rates ( percent NUMBER(3,2), salary_min NUMBER(8,2), salary_max NUMBER(8,2)); Program Description · Create two PL/SQL blocks that will insert or delete rows from the employee deduction table. Include exception processing for bad input data and verify that an employee is eligible for a deduction based upon their salary grade. Salary grade is determined by checking the salary grade table to derive the employee’s salary grade. Once you know an employee’s grade, then verify if the employee is eligible for the deduction (e.g. 401K) via comparing it to the minimum and maximum salary grade that is stored in the deduction table ( see definition above).
  • 11. · Create two database triggers that will update the employee audit table and employee deduction audit table when rows are either changed or deleted. Use a sequence number to assign a unique identifier to each row as it is created in the audit table. Capture the user ID, date of the change or delete, and action (update or delete), plus all the fields in the before image of the row (e.g. before it is changed or deleted). · Create a function that will count the number of deductions for an employee. Input to the function is the employee ID and it returns the count of employee deductions. If there aren’t any deductions for the employee, the function returns zero. Within the view, include the employee name, number, hire date, job, dept number and the umber of deductions for the employee. Use the naming standard <name>_v. CREATE or REPLACE VIEW show_deduction_v AS SELECT empno, ename, hiredate, deptno, job, count_deductions(empno) deduction_cnt FROM emp; · Create a package that contains multiple stored procedures. Only one procedure will be available to external calls (in the package specifications). The other procedure will be subroutines that are called by the main procedure in the package body. It is okay to include stored functions in your package that support the procedure. The procedure will accomplish the following steps for each employee: · Subtract the before tax deductions from the monthly salary.
  • 12. · Calculate and subtract Federal Tax and State Income using the tax table that you created (see above). For more of a challenge, initially load the tax table into a PL/SQL table that resides in memory (optional). Use the same rate for Federal Income Tax (FIT) and State Income Tax (SIT). · Exclude other taxes (e.g. SS) · Include commission as part of the salary · Subtract after tax deductions from the remaining monthly salary to determine the net pay. · Use DBMS_OUTPUT to display all deductions/calculations and net pay. This will enable you to turn spool on and capture all the calculations for all employees when you execute the procedure via SQL*Plus. Deliverables · Listing of code for every block (function, trigger, a package with procedures, etc.) defined above. · Unit test data for every block defined above (use the spool command). Note: I’ll check test results from the pre-calc program with a calculator. The net pay amount must be correct for full credit. Include test data dumps of every table so that I can verify your test results. · MAKE A LIST OF DELIVERABLES AND CHECK IT TWICE. IF YOU LEAVE OUT A PIECE OF CODE OR UNIT TEST DATA, YOU WILL NOT RECEIVE FULL CREDIT. Appendix Insert into dept
  • 13. values (10, 'ACCOUNTING', 'NEW YORK'); Insert into dept values (20, 'RESEARCH', 'DALLAS'); Insert into dept values (30, 'SALES', 'CHICAGO'); Insert into dept values (40, 'OPERATIONS','BOSTON'); insert into emp values (7369, 'SMITH', 'CLERK', 7902, '17-DEC-80', 800,NULL,20); insert into emp values (7499, 'ALLEN', 'SALESMAN', 7698, '20-FEB-81', 1600, 300, 30); insert into emp values (7521, 'WARD', 'SALESMAN', 7698, '22-FEB-81', 1250, 500, 30); Insert into emp values (7566, 'JONES', 'MANAGER', 7839, '02-APR-81', 2975,NULL, 20); Insert into emp
  • 14. values (7654, 'MARTIN', 'SALESMAN', 7698, '28-SEP-81', 1250, 1400, 30); Insert into emp values (7698, 'BLAKE', 'MANAGER', 7839, '01-MAY-81', 2850,NULL, 30); Insert into emp values (7782, 'CLARK', 'MANAGER', 7839, '09-JUN-81', 2450, NULL, 10); Insert into emp values (7788, 'SCOTT', 'ANALYST', 7566, '19-APR-87', 3000,NULL, 20); Insert into emp values (7839, 'KING', 'PRESIDENT',NULL , '17-NOV-81', 5000,NULL, 10); Insert into emp values (7844, 'TURNER', 'SALESMAN', 7698, '08-SEP- 81',1500,0, 30); Insert into emp values (7876, 'ADAMS', 'CLERK', 7788, '23-MAY- 87',1100,NULL, 20); Insert into emp values (7900, 'JAMES', 'CLERK', 7698, '03-DEC-81',
  • 15. 950,NULL, 30); Insert into emp values (7902, 'FORD', 'ANALYST', 7566, '03-DEC- 81',3000,NULL, 20); Insert into emp values (7934, 'MILLER', 'CLERK', 7782, '23-JAN-82',1300, NULL, 10); Insert into salgrade values(1, 700, 1200); Insert into salgrade values (2, 1201, 1400); Insert into salgrade values (3, 1401, 2000); Insert into salgrade values (4, 2001, 3000); Insert into salgrade values (5, 3001, 9999); commit;