PL/SQL, SQL
If anyone is bored, please give me thoughts:
Imagine yourself as a graphic designer, in your last semester of college, and for some reason your degree requires you to take this last C-S course. You know nothing about programming, or programming languages. Go.
---
1) Create a database with two tables: Employee and Division. The employee table should contain a unique employee ID, employee name, and manager ID. Manager ID in row X is the ID of the employee who is the direct manager of the employee in row X. The division table should contain a unique division name, a division location, and a manager ID. The manage ID is the employee ID of the employee who is the direct manager of the division. Write create table statements for the database and insert sample data.
2) Create a PL/SQL procedure that is passed the name of a division and prints to standard output the employee names of employees who are directly or indirectly managed by the manager of the division whose name was passed to the procedure.
3) Create a trigger that is invoked when a new row is inserted into the division table. The trigger should enforce the constraint that an employee can be the direct manager of at most one division. Because of the mutating table problem you will not be able to check this constraint by looking directly at the division table. Instead consider the constraint violated if a row is inserted into division with a manager ID value that appears as a manager in the employee table.
---
Gracias.
__________________
I'd rather regret what I did do than what I didn't.
|