Question: Using SQL complete Exercise 8 SQL Functions and Procedures 8. Assume the TRIP table contains a column named TOTAL PERSONS that represents the total number
SQL Functions and Procedures 8. Assume the TRIP table contains a column named TOTAL PERSONS that represents the total number of persons for that trip. Following the style shown in the text, write the code in PL/SQL or T-SQL for the following triggers: When inserting a row in the RESERVATION table, add the NUM_PERSONS value to the TOTAL PERSONS value for the appropriate trip. a. b. When updating a row in the RESERVATION table, add the difference between the new NUM PERSONS value and the old NUM PERSONS value to the TOTAL PERSONS value for the appropriate trip. When deleting a row in the RESERVATION table, subtract the NUM_PERSONS value from the TOTAL_PERSONS value for the appropriate trip. c. Because the TRIP table contains several columns with character data, the staff at Colo- duanture Tours would like to know more about string or character functions. Use the TD ond INITCAP. Are
Step by Step Solution
There are 3 Steps involved in it
To create the specified triggers we will need to write SQL code using a procedural extension like PLSQL for Oracle databases or TSQL for SQL Server Be... View full answer
Get step-by-step solutions from verified subject matter experts
