View the step-by-step solution to:

Question

Wedgewood Pacific Exercises

In the Chapter 7 Review Questions, we introduced Wedgewood Pacific (WP) and

developed the WP database. Two of the tables that are used in the WP database are:

 

DEPARTMENT (DepartmentName, BudgetCode, OfficeNumber, DepartmentPhone)

EMPLOYEEE (EmployeeNumber, FirstName, LastName, Department, Position, Supervisor, OfficePhone, EmailAddress)

 

Assume that the relationship between these tables is M-M, and use the tables as the basis for your answers to Exercises 10B.68-10B.70.

10B.68 Code an Oracle Database trigger to enforce the constraint that an employee can never change his or her department.

10B.69 Code an Oracle Database trigger to allow the deletion of a department if it has only one employee. Assign the last employee to the Human Resources department. Assume the trigger in Review Question 10B.68 has not been created. HINT: Due to Oracle Database "mutating table" issues, the best solution here is to show a view that is a copy of the DEPARTMENT table and base the trigger on that view.

10B.70 Design a system of triggers to enforce the M-M relationship. Use Figure 10B-72 as an example, but assume that departments with only one employee can be deleted. Assign the last employee in a department to Human Resources. HINTS: You will need four triggers, but one of them is the solution to Review Question 10B.69. Also, you may need to create views for some or all of the remaining three triggers.

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Let our 24/7 Computer Science tutors help you get unstuck! Ask your first question.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors