Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This question is from my database class; using SQL In this part we create a small procedure: Write a procedure that has as input the

This question is from my database class;

using SQL

In this part we create a small procedure:

Write a procedure that has as input the customer_id. Then the procedure should delete the corresponding customer from table customers.

Notice that customer_id is a foreign key on table orders. Therefore the customer cannot be deleted if he has placed orders. To delete a record from customers you should first delete the corresponding orders and to do that you need to first delete the corresponding order_details.

Now execute the procedure to delete customer with id 1. If you have solved part 01 a record will be inserted into Customer_Archives.

ROLLBACK; and all these changes will be undone!

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

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions

Question

=+j Explain IHRMs role in global HR research.

Answered: 1 week ago

Question

=+j Describe an effective crisis management program.

Answered: 1 week ago