Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MyQSL Q.6) (15 points) Write a DELETE statement that deletes the row that you added to the addresses table in Question 2 above. Note that

MyQSL
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Q.6) (15 points) Write a DELETE statement that deletes the row that you added to the addresses table in Question 2 above. Note that deleting the address record that was added in Q2 will leave the order record added in Q3 an "orphan", since the ship_address_id of the record will point to an address that does not exist in the database anymore. To eliminate the orphan record problem, precede the DELETE statement with another DELETE statement that deletes all rows in orders that were shipped to that address. Hints: Remember that to code two or more statements in a script, you must end each statement with a semicolon. You need to turn Workbench's "Safe Updates" option off before you can run these DELETE queries. See the lecture slides for instructions; you must include this in the script that you submit. - - my guitar_shop Tables addresses | Columns address id customer_id linel line2 city state zip_code phone disabled Indexes PRIMARY addresses_fk_customers Foreign Keys addresses_fk_customers addresses fk_customens > Triggers administrators admin_id email_address password first_name last_name ep Indexes PRIMARY Foreign Keys Triggers | categories Columns category_id category_name ep Indexes PRIMARY PRIMARY category-name Foreign Keys Triggers | | customers C] columns customer_id email address password first name last_name shipping-addressid billing-address-d - E Indexes PRIMARY emailaddress - Foreign Keys Triggers -order-items | order-items -Columns item_id orderid - product_id item-price discountamount - quantity Indexes PRIMARY items fk orders items_fk_products Foreign Keys items.fk-orders Triggers Columns items_fk_produds orders order-id order_id customer_id order date ship-amount tax amount ship_date ship-address-id card_type card_number card-expires billing address_id ep Indexes PRIMARY ordersfkcustomers - - VE Foreign Keys orders_fk_customers ] Triggers products [05] Columns o columns product_id category_id product-code product-name description list-price discount-percent dateadded - ep Indexes PRIMARY product-code products-fk. categories VE Foreign Keys products_fk_categories Triggers Views Stored Procedures Functions

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

What goals led to the formation of Equal Exchange?

Answered: 1 week ago