Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

SIES College of Arts, Science & Commerce, Sion West

ASSIGNMENT
CLASS : SYBSc. Computer Science Semester -III
Subject : Database Management Systems Academic Year: 2018-2019

A) Write short note on Clustered File Organization.


B) List out reasons to use triggers.
C)

D) Write Short note on ARIES algorithm.


E) Explain the working of Write-ahead log protocol

F)
Write a function that calculates tax on a personnel member’s salary.
You should then be able to test your function by typing something like:

SELECT surname, first name, salary, tax(35000,500) from dual; (the two parameters
being salary and bonus respectively).

Things you need to know and incorporate (read carefully and try to work out the
formulae from the information given):
1. Pass two parameters for salary and bonus
2. Taxable salary is the salary + bonus – tax allowance
3. Tax allowance is a constant at £4335
4. There are two tax limits at £3999 (lower) and £28999 (upper)
5. Salary is tested against these tax limits
6. If salary is less than the lower tax limit then tax is calculated as 10% of taxable
salary
7. If salary is between the two tax limits then tax is calculated as 22% of taxable
salary
8. If salary is higher than the upper tax limit then tax is calculated as:

22% of the upper limit + 40% of the difference between the taxable salary and
the upper limit.

G) Create a routine that could be run each month to insert pension contribution details into a
PENSIONS table. So create the table first.

Your code should accept three prompts:


a) the date
b) the amount of employee contribution (less than 10%).
c) the amount of employer contribution (less than 10%).

The calculation you need to consider is simply:

Salary * contribution /12 (as it is a monthly contribution).

You’ll need to declare variables for all of your prompts and for anchoring variables to the
datatypes in the PENSIONS table for the insertion of data.

H) Write a PL/SQL block that prints the number of employees (using the table
EMPLOYEES) who earn plus or minus $100 of the salary value set for a SQL*Plus
substitution variable. Use the DEFINE command to provide the salary value (as given
below). Pass the value to the PL/SQL block through a SQL*Plus substitution variable.
VARIABLE g_message VARCHAR2(100) SET VERIFY OFF DEFINE p_sal = 7000 a.
If there is no employee within that range, print a message to the user indicating that is the
case. Use an exception for this case. b. If there is more than 1 employee within that range, the
message should indicate how many employees are in the salary range. c. Handle any other
exception with an appropriate exception handler. The message should indicate that some
other error occurred.
I)
For the exercise below, you will require a table to store the results. You can create the
analysis table by using the commands below : CREATE TABLE analysis (ename
varchar2(20), years number(2), sal number(8,2)); Write a PL/SQL block to populate the
analysis table with the information from the employees table. To do this, you must query the
employees table to find if the number of years that the employee has been with the
organization is greater than five, and if the salary is less than 3,500 and if so, raise an
exception(user-defined) . Handle the exception with an appropriate exception handler that
inserts the following values into the analysis table: employee last name, number of years of
service, and the current salary. Otherwise display ‘Not due for a raise’ .
NOTE: 1. SYSDATE gives the SYSTEM date.
NOTE: 2. You can use the function MONTHS_BETWEEN to get the number of years. For
example, select MONTHS_BETWEEN(SYSDATE,TO_DATE('30-OCT-2009')) from dual;
gives a result of MONTHS_BETWEEN(SYSDATE,TO_DATE('30-OCT-2009'))

You might also like