Answered step by step
Verified Expert Solution
Question
1 Approved Answer
solve these short sql questions Question 2 Figure Q2 shows a simplified Pet Shop employee database application, employee table and department table. Employee table has
solve these short sql questions
Question 2 Figure Q2 shows a simplified Pet Shop employee database application, employee table and department table. Employee table has supervisorID, a recursive foreign key to Employee table. We assume that NULL is allowed for deptNo, indicating that an employee may be temporarily unassigned to any department. Each department has a manager which is a foreign key Employee table. TotalSalary attribute is a derived attribute where the value is the sum of the salaries of all employees in the department. DEPARTMENT EMPLOYEE emplo empName Salary depto supervisor Figure Q2: Simplified Pet Shop employee database a) Examine any THREE (3) possible events (event 1, event 2 and event 3) that may cause a change in the totalSalary Write your answers in just ONE (1) sentence for each event. (3 marks) b) From your answers in Q2a), determine the conditions to be checked for event 1, event 2 and event 3. Write your answers in just ONE (1) sentence for each event. (4 marks) Use TRIGGER clause to solve the actions for event 1, 2 and 3 above to automatically update the totalSalary for the department to reflect the new employee's salary. (18 marks) Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started