Question: How would one compose a PL/SQL Trigger that will fires when a row is deleted in the PRODUCTS table? The trigger should delete the row

  1. How would one compose a PL/SQL Trigger that will fires when a row is deleted in the PRODUCTS table? The trigger should delete the row from the PRODUCT_STATS table based on the shared product_id.

Language SQL V D C 1 select PRODUCTS.PRODUCT_ID as PRODUCT_ID 2 from PRODUCTS PRODUCTS 3 SELECT p.product_id 

Language SQL V D C 1 select PRODUCTS.PRODUCT_ID as PRODUCT_ID 2 from PRODUCTS PRODUCTS 3 SELECT p.product_id 4 FROM products p , product_stats ps WHERE p. product_id = ps.product_id; CREATE [ OR REPLACE ] TRIGGER id_delete AFTER DELETE 5 6 7 8 9 10 11 12 Q on PRODUCTS FOR EACH ROW DECLARE Rows 10 A:: Results Explain Describe Saved SQL History Enter SQL statement or PL/SQL command and click Run to see the results. Clear Command Find Tables Save Run

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 Create a trigger with the appropriate timing and scope 2 Use a PLSQL block within the trigger to ... View full answer

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!