Create a trigger called new_agent.
1. [10 pts] Create a trigger called new_agent. The trigger will identify when an insert into the Booking table does not reference an existing agent in the TravelAgent table. When this occurs, the new agent needs to be added into the TravelAgent table. Insert the new agent into the TravelAgent table with 0 years of experience and a NULL phone number. Note, this scenario could also be resolved by creating a foreign key reference from Booking(agent) to the TravelAgent(name). Recall, the foreign key constraint limit the database response to simply would not allow for updating TravelAgent with the new agent. Instead, the insert into Booking would just be rejected. 2. [7 pts] Create an SQL function called int compare_dates(date_1, date_2). The function will return -1, 0, or 1 depending upon whether date_1 is [note these return values follow Java’s Comparable/Comparator pattern]:
The post Create a trigger called new_agent. appeared first on My Assignment Online.
