[Solved] CSCI317-Assignment 1 PLSQL Procedures and Triggers

$25

File Name: CSCI317_Assignment_1_PLSQL_Procedures_and_Triggers.zip
File Size: 471 KB

SKU: [Solved] CSCI317-Assignment 1 PLSQL Procedures and Triggers Category: Tag:
5/5 - (1 vote)

Tasks

Task 1. Stored procedure )

Implement a stored PL/SQL procedure APPLICATIONS to list the applicants and their applications.

The names of applicants must be listed in the descending order of last names of applicants. The position number and title of a position applied by an applicant must be listed in the ascending order of position number.

Execute the stored PL/SQL procedure APPLICATIONS. A fragment of expected sample printout is given below.

16 Zhi Chao Zhong:

2 Johnny Walker:

1 lecturer

6 professor 14 Ivan TheTerrible: 17 Richard TheLionheart:

Implement a solution as PL/SQL stored procedure and save it in SQL script file solution1.sql. Then, process the script and save a report in a file solution1.lst. It is explained in Cookbook, Recipe 2.5 How to use SQL*Plus client ?, Step 9 how to create and how to save a report from processing of SQL script.

Your report must include listing of all SQL statement processed. To achieve that put the following SQL*Plus commands:

SET ECHO ON

SET FEEDBACK ON

SET LINESIZE 100

SET PAGESIZE 100

SET SERVEROUTPUT ON

at the beginning of SQL script solution1.sql.

Task 2. Stored function

Implement a stored PL/SQL function APPLICANTSKILLS that takes an applicant number (anumber) as a parameter, and finds all the skills possessed by the applicant.

The function must return a string of characters that contains the first and last name of an applicant, skill name and level that the applicant possessed.

Execute the stored PL/SQL function APPLICANTSKILLS for all applicants. A fragment of sample printout is given below:

  • Harry Potter: C programming 4 Java programming 9 cooking 9
  • Johnny Walker: Java programming 9 driving 9
  • Mary Poppins: C++ programming 10 Java programming 9

painting 5

  • Michael Collins:
  • Margaret Finch: SQL programming 6 6 Claudia Kowalewski: SQL programming 8

Save your implementation of Task 2 in SQL script file solution2.sql. Then, process the script and save a report in a file solution2.lst. It is explained in Cookbook, Recipe 2.5 How to use SQL*Plus client ?, Step 9 how to create and how to save a report from processing of SQL script.

Your report must include listing of all SQL statement processed. To achieve that put the following SQL*Plus commands:

SET ECHO ON

SET FEEDBACK ON

SET LINESIZE 100

SET PAGESIZE 200

SET SERVEROUTPUT ON

at the beginning of SQL script solution2.sql.

Task 3 Statement trigger

Implement and comprehensively test a statement trigger that verifies the following consistency constraint.

A position cannot need more than 4 skills.

When ready save your CREATE TRIGGER statement and all SQL statements that comprehensively test a trigger in a script solution3.sql. Comprehensive testing means that the trigger must reject SQL statements that violate the consistency constraint and accept SQL statements that do not violate the consistency constraint. It is a part of your task to find what SQL statements should be tested. Whenever SQL statement violates the consistency constraint a trigger must return ORA- error message. Use a procedure RAISE_APPLICATION_ERROR to return ORA- error message. If SQL statement does not violate the consistency constraint then a trigger must return no messages.

Process SQL script file solution3.sql and save a report from processing in a file solution3.lst.

Your report must include listing of all SQL statement processed. To achieve that put the following SQL*Plus commands:

SET ECHO ON

SET FEEDBACK ON

at the beginning of SQL script solution3.sql.

Task 4 Row trigger

Implement and comprehensively test a row trigger that verifies the following consistency constraint.

An applicant cannot apply for a position during the last 30 days from his/her the previous application for the same position.

Hint:

No need to consider the UPDATE event.

When ready save your CREATE TRIGGER statement and all SQL statements that comprehensively test a trigger in a script solution4.sql. Comprehensive testing means that the trigger must reject SQL statements that violate the consistency constraint and accept SQL statements that do not violate the consistency constraint. It is a part of your task to find what SQL statements should be tested. Whenever SQL statement violates the consistency constraint a trigger must return ORA- error message. Use a procedure RAISE_APPLICATION_ERROR to return ORA- error message. If SQL statement does not violate the consistency constraint then a trigger must return no messages.

Process SQL script file solution4.sql and save a report from processing in a file solution4.lst.

Your report must include listing of all SQL statement processed. To achieve that put the following SQL*Plus commands:

SET ECHO ON

SET FEEDBACK ON

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CSCI317-Assignment 1 PLSQL Procedures and Triggers[Solved] CSCI317-Assignment 1 PLSQL Procedures and Triggers
$25