DBMS LAB ASSIGNMENT 7

************PROCEDURES*******************

1. Write a Procedure debit_account that accepts a account number and amount to update the account.

2. Write a procedure to create a department. The procedure accepts two parameters dept no, deptname

3. Write a Procedure to raise salary of an employee. The procedure accepts two parameters employee code, amount increased.

****************FUNCTIONS*********************

4. Write a function that checks if salary is in range or not. The procedure accepts two parameters employeeno , designation. Call it from a procedure that accepts only employee code. You have to write the procedure also.

NOTE: PROCEDURES AND FUNCTIONS are stored in the executable code and not source code.

5. Write a function that returns the balance of an account. The function accepts only one parameter account no. call it from procedure that accepts only one account no. you have to write the procedure also.

***************out parameter******************

6. Write a procedure that calculates the bonus of an employee. It accepts the employee number and bonus value as parameters. This procedure should return value i.e. the latest bonus i.e. the last bonus+ the bonus value sent. Call this procedure from another procedure where you should send only the employee code.

USE AN OUT PARAMETER.

********************In out parameter*******************

7. Write a procedure that updates the account when an amount is withdrawn i.e. balance-the amount withdrawn. This procedure should return the balance amount. The procedure accepts two parameters account no, amount. Call this procedure from another where you should send the account code and the amount to debit.

*************************in parameter***************

8. Write a procedure that updates the account when an amount is withdrawn. i.e. balance –the amount withdrawn. This procedure should return the balance amount. This procedure should return any value. the procedure accepts two parameters account no, amount.