Question: You are required to create a trigger named update _ total _ amount _ trigger that automatically updates the total _ amount column whenever a

You are required to create a trigger named "update_total_amount_trigger" that automatically updates the total_amount column whenever a new row is inserted into the table. The trigger should calculate the total amount based on a fixed tax rate of 10% on the order date. For example, if the order_date is '2023-06-01' and the inserted row has a total_amount of 100, the trigger should update the total_amount to 110. Write the SQL code to create the "update_total_amount_trigger" trigger.
Tables Schema as Below:
orders
columnName dataType
order_id INTEGER
order_date DATE
total_amount REAL

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!