Question: Using the tables provided above, provide SQL statements for the following queries Provide the implementation of the following triggers. For submission, please include both the

Using the tables provided above, provide SQL statements for the following queries
Provide the implementation of the following triggers. For submission, please include both the PL/SQL code and a DML statement (insert, update or delete) to demonstrate the trigger functionality.
a. A trigger that prevents a full-time employee from applying for a franchise if he/she has less than 10 years of experience as an employee of H2H.
b. A trigger that automatically backs-up a weekly sales report when it is deleted. To preserve the data, the trigger stores the deleted report into a backup table:
BackupReport (ReportID, StartDate, EndDate, SaleAmount)
Below is the sample data for ACCOUNT Table
-----INSERT STATEMENTS FOR ACCOUNT (AccountNo, AccountName, Balance)----- INSERT INTO ACCOUNT VALUES ('AC001', 'H2H Thomastown Electronics', 100000.00); INSERT INTO ACCOUNT VALUES ('AC002', 'H2H Thomastown Computers', 925000.00); INSERT INTO ACCOUNT VALUES ('AC003', 'H2H Thomastown Beddings', 85000.00); INSERT INTO ACCOUNT VALUES ('AC004', 'H2H Thomastown Furniture', 350000.00); INSERT INTO ACCOUNT VALUES ('AC005', 'H2H Thomastown Kitchenware', 192000.00); INSERT INTO ACCOUNT VALUES ('AC006', 'H2H Thomastown Cookwares', 252000.00); INSERT INTO ACCOUNT VALUES ('AC007', 'H2H Thomastown Laundry', 95000.00); INSERT INTO ACCOUNT VALUES ('AC008', 'H2H Reservoir Electronics', 550000.00); INSERT INTO ACCOUNT VALUES ('AC009', 'H2H Reservoir Computers', 600000.00); INSERT INTO ACCOUNT VALUES ('AC010', 'H2H Reservoir Beddings', 452000.00); INSERT INTO ACCOUNT VALUES ('AC011', 'H2H Reservoir Furniture', 356000.00); -----INSERT STATEMENTS FOR EMPLOYEE Table
INSERT INTO EMPLOYEE VALUES ('E001', 'Samin Nixon', '0450777435', 'e001@h2hmail.com', '34 Waratah St, Thomastown, VIC 3074', 'M', to_date('11-12-1989','dd-mm-yyyy'), to_date('11-03-2017','dd-mm-yyyy'), 'Local', 'EFTPOS001', null, 'D001'); INSERT INTO EMPLOYEE VALUES ('E002', 'Alex Ferrer', '0450788435', 'e002@h2hmail.com', '99 Whitelaw St, Reservoir, VIC 3072', 'M', to_date('10-05-1988','dd-mm-yyyy'), to_date('01-02-2018','dd-mm-yyyy'), 'Central', null, 'CAN001', 'D001'); INSERT INTO EMPLOYEE VALUES ('E003', 'John Paul', '0450788422', 'e003@h2hmail.com', '33 Rathcown Rd, Reservoir, VIC 3072', 'M', to_date('10-05-1988','dd-mm-yyyy'), to_date('01-01-2008','dd-mm-yyyy'), 'Local', 'EFTPOS002', null, 'D001'); INSERT INTO EMPLOYEE VALUES ('E004', 'Paul James', '0450788433', 'e004@h2hmail.com', '32 Rathcown Rd, Reservoir, VIC 3072', 'M', to_date('19-04-1988','dd-mm-yyyy'), to_date('01-01-2008','dd-mm-yyyy'), 'Central', null, 'CAN002', 'D001'); INSERT INTO EMPLOYEE VALUES ('E005', 'Jacob John', '0450788444', 'e005@h2hmail.com', '23 Rathcown Rd, Reservoir, VIC 3072', 'M', to_date('10-02-1988','dd-mm-yyyy'), to_date('01-01-2009','dd-mm-yyyy'), 'Local', 'EFTPOS003', null, 'D001'); INSERT INTO EMPLOYEE VALUES ('E006', 'Marin Albert', '0450788421', 'e006@h2hmail.com', '16 Malachi Rd, Reservoir, VIC 3072', 'M', to_date('14-04-1988','dd-mm-yyyy'), to_date('01-01-2009','dd-mm-yyyy'), 'Local', 'EFTPOS004', null, 'D002'); INSERT INTO EMPLOYEE VALUES ('E007', 'Joseph Mathew', '0450788212', 'e007@h2hmail.com', '18 Hall Rd, Reservoir, VIC 3072', 'M', to_date('10-05-1984','dd-mm-yyyy'), to_date('01-01-2008','dd-mm-yyyy'), 'Central', null, 'CAN003', 'D002'); INSERT INTO EMPLOYEE VALUES ('E008', 'Mathew Joseph', '0450788221', 'e008@h2hmail.com', '19 Macaulay Rd, Reservoir, VIC 3072', 'M', to_date('10-05-1989','dd-mm-yyyy'), to_date('01-01-2008','dd-mm-yyyy'), 'Local', 'EFTPOS005', null, 'D003'); INSERT INTO EMPLOYEE VALUES ('E009', 'Annie Macaulay', '0450788556', 'e009@h2hmail.com', '42 Luca Rd, Reservoir, VIC 3072', 'M', to_date('15-05-1988','dd-mm-yyyy'), to_date('01-01-2008','dd-mm-yyyy'), 'Central', null, 'CAN004', 'D003'); INSERT INTO EMPLOYEE VALUES ('E010', 'Danny James', '0450788786', 'e010@h2hmail.com', '45 Alan Rd, Reservoir, VIC 3072', 'M', to_date('14-05-1988','dd-mm-yyyy'), to_date('01-01-2008','dd-mm-yyyy'), 'Local', 'EFTPOS006', null, 'D004'); INSERT INTO EMPLOYEE VALUES ('E011', 'Mary Mathew', '0450788567', 'e011@h2hmail.com', '67 Jacob Rd, Reservoir, VIC 3072', 'M', to_date('13-05-1988','dd-mm-yyyy'), to_date('01-01-2008','dd-mm-yyyy'), 'Central', null, 'CAN005', 'D004'); INSERT INTO EMPLOYEE VALUES ('E012', 'Anthony George', '0450788765', 'e012@h2hmail.com', '72 Marin Rd, Reservoir, VIC 3072', 'M', to_date('11-05-1988','dd-mm-yyyy'), to_date('01-01-2008','dd-mm-yyyy'), 'Local', 'EFTPOS007', null, 'D005'); INSERT INTO EMPLOYEE VALUES ('E013', 'Danny Sebastian', '0450788234', 'e013@h2hmail.com', '82 Albert St, Reservoir, VIC 3072', 'M', to_date('10-05-1988','dd-mm-yyyy'), to_date('01-01-2008','dd-mm-yyyy'), 'Central', null, 'CAN006', 'D005'); INSERT INTO EMPLOYEE VALUES ('E014', 'Bob Murray', '0450788543', 'e014@h2hmail.com', '42 Silas Rd, Reservoir, VIC 3072', 'M', to_date('10-05-1988','dd-mm-yyyy'), to_date('01-01-2013','dd-mm-yyyy'), 'Local', 'EFTPOS008', null, 'D006'); INSERT INTO EMPLOYEE VALUES ('E015', 'Andy James', '0450788453', 'e015@h2hmail.com', '44 Weston Rd, Reservoir, VIC 3072', 'M', to_date('20-05-1988','dd-mm-yyyy'), to_date('01-01-2008','dd-mm-yyyy'), 'Local', 'EFTPOS009', null, 'D006'); INSERT INTO EMPLOYEE VALUES ('E016', 'Steve Nixon', '0450788876', 'e016@h2hmail.com', '33 Camden Rd, Reservoir, VIC 3072', 'M', to_date('24-05-1988','dd-mm-yyyy'), to_date('01-01-2014','dd-mm-yyyy'), 'Central', null, 'CAN007', 'D006');To run the file, issue the following command: @D:\dbf\H2HSchema.sql Where D: dbf is the location of the file (for example)! NOTE: YOU DO NOT NEED TO INSERT MORE DATA INTO THE TABLES. The list of tables available for this assignment is the following: STORE (StoreID, StoreAddress, WeekDaysHours, WeekendHours) ACCOUNT (AccountNo., AccountName, Balance) DEPARTMENT (DepartmentID, DepartmentTitle, Noof Employees, AccountNo, StoreID, Franchise TeamID) WEEKLY SALES REPORT (ReportID, StartDate, EndDate, SaleAmount, ComRate, ComAmount, BrandID, BName, BSaleAmount, TypeID, TName, TSaleAmount, EmployeeID, Ename, ESaleAmount, EBonus, DepartmentID) FRANCHISE APP (AppNumber, AppDate, DecisionDate, Status, DepartmentID, TeamID) EMPLOYEE (EmployeeID, Name, Phone, Email, Address, Gender, DOB, JoiningDate, CentralorLocal Employment, EFT POSID, CANumber, DepartmentID) CASUAL EMPLOYEE (EmployeeID, HourlyRate) PART_TIME_EMPLOYEE (EmployeeID, WeeklyHours, Salary) FULL TIME EMPLOYEE (EmployeeID, LeaveDays, Salary, MemberID) TEAM_MEMBER (MemberID) SHAREHOLDER (S.H.ID, Name, Phone, Email, Address, NoofShares, MemberID) TEAM (TeamID, TeamName, TeamLeaderID) MEMBERSHIP (MemberID, TeamID, Percentage of Share) NOTE: PK is printed underlined and FK is printed italic in italics
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
