0% found this document useful (0 votes)
16 views1 page

pr02 - PLSQL-trigger Exercises

Uploaded by

Eyyoub Soullami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views1 page

pr02 - PLSQL-trigger Exercises

Uploaded by

Eyyoub Soullami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

PLSQL and Trigger exercises

1. Create a procedure that outputs „Hello world!”!


2. Create a function which decides if the given number is a prime!
3. Create a function which calculates the factorial of a number!
4. Create a function which calculates how many times a string occurres in another string!
5. Create a function which returns the average salary of employees in a salary category! Use
cursor!
6. Create a procedure which takes the employees in alphabetical order and outputs the name
and salary of the ones with odd rownumber! Use cursor!
7. Create the table ’emp2’ from the table ’emp’ and add a row_num column to it! Create a
procedure, which fills this column with increasing number in lexicongraphical order of the
employees for every employee in emp2! Use cursor!
8. Create a procedure that increases the salary of those employees in ’emp2’ by 50% who have
a prime number in the row_num column! Use cursor!
9. Create a procedure which deletes the employees in the given salary category from the table
’emp2’! Use cursor!
10. Create a procedure that increases the salary of the employees, whose salary is in the given
salary category, by 1! After the modification, output the modified average of salary!
11. Create a view that shows the employee number, name, department number, name and
location of the employees work in Boston or Chicago! Create a trigger that inserts rows into
the base tables for the previous view instead of the view!
12. Create a trigger that creates a new department with the new deptno when someone tries to
insert or update an employee in the emp table who works at a deptno which does not exists
yet in the dept table!

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy