Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The company that you work for wants to create a review process for orders that were CANCELLED or REFUNDED as the ORDER_STATUS in the Order

The company that you work for wants to create a review process for orders that were CANCELLED or REFUNDED as the ORDER_STATUS in the Order table shows. Create a view in the PL/SQL command window by copying and pasting this code: CREATE OR REPLACE VIEW vw_incomplete_orders AS SELECT o.order_id,order_status,to_char(order_datetime,'MM/DD/YYYY') OrderDate,store_id,product_id,(unit_price * quantity) AS MoneyLost FROM orders o ,order_items oi WHERE o.order_id = oi.order_id AND o.order_status <> 'COMPLETE'; Run the code to create the view.

Create an instead of trigger named TRGR_INCOMPLETE_ORDERS that will fire when the ORDER_STATUS in the vw_incomplete_orders VIEW is updated to REVIEWED. Have the trigger delete from the ORDER_ITEMS and ORDERS table based on order_id. Use the bind variable :new.ORDER_STATUS. Use an IF/END IF block to check the updated order status.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions

Question

1. Television more Over watching faceing of many problems ?

Answered: 1 week ago

Question

Is there a link between chronic stress and memory function?

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago