Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1 To create a trigger: when some records are deleted from the emp table, the deleted records are written into an employee history table(create

image text in transcribed
Problem 1 To create a trigger: when some records are deleted from the emp table, the deleted records are written into an employee history table(create the history table firstly). CREATE TABLE emp_his AS SELECTFROM EMP WHERE 1-2; CREATE OR REPLACE TRIGGER tr del emp after DELETE Specifies the trigger time to trigger the delete operation ON scott.emp FOR EACH ROW Description created is a row level trigger BEGIN insert the modified data to the log record table del emp, for supervision INSERT INTO emp his (deptno, empno, ename , job ,mgr , sal, comm hiredate) VALUES old.deptno, old.empno, old.ename, old.job, old.mgr, old.sal, old.comm, old.hiredate) END Problem 2 Design a row trigger: when the value of deptno column in the DEPT table is updated, the corresponding deptno value in the EMP table is also modified. Problem 3 Design a row trigger for updating of emp table, when modifying the salary update the sum of the corresponding department(add a sumsalary coulmn to dept table firstly). Problem 4 To create a trigger: when some records are deleted from the emp table, the summary account of employees are written into an dept table(add a persons coulmn to dept table firstly)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting And Auditing Research And Databases Practitioner's Desk Reference

Authors: Thomas R. Weirich, Natalie Tatiana Churyk, Thomas C. Pearson

1st Edition

1118334426, 978-1118334423

More Books

Students also viewed these Databases questions

Question

ppropriate in response to employee feedback.

Answered: 1 week ago

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago