You are on page 1of 10

DBMS Lab Assignment – 06

Name : Sachin Mahendra Gaikwad


Roll No : 207941
Reg No : MC20151

Employee Table
Project Table
2. Write a Stored Procedure to retrieve records (rows) from above two tables.
3. Write a Stored Procedure to retrieve emp_name, salary where salary is greater than
60000 and salary is passed as a parameter to the procedure.

4. Write a Stored Procedure to declare an integer variable and set value as 100 and display
the variable.
5. Delete the above procedure (4th question).

6. Write a Stored Procedure to Display the count of projects that are assigned emp_name =
’Shiva’ pass emp_name as a parameter.

7. Display all the Stored Procedures that are created till now.
8. Write a Stored Procedure to display if the given integer is positive or negative (integer is
the parameter).
-- getSign(IN input INT(10)) -- input format
1 if the number is positive
-1 if the number is negative
0 if the number is zero
9. Write a Stored Procedure for given integer print all the even numbers till the given input.
-- printEven(IN input INT(10))

-- sample Input : CALL printEven(12)

-- sample output :2,4,6,8,10,12,


10. Write a Stored Procedure display square of a number, if given input is negative exit
procedure.
11. Write a stored Function to return incomelevel of employee
If given input is greater than 700000 then incomelevel is ‘Grade I’

If given input is between 700000 and 500000 then incomelevel is ‘Grade II’

If given input is less than 500000 then incomelevel is ’Grade III’

12. Retrieve emp_name, salary, incomelevel from employee table using above stored
function
13. Display all the Stored Procedures with a pattern which has nine letters in its name.

14. Display all Stored Functions.

15. Delete all Stored Procedures that are created in this assignment.

You might also like