Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am not sure on how to query this situation. Why would I need 2 Update queries? I dont have to have this query solved

I am not sure on how to query this situation. Why would I need 2 Update queries? I dont have to have this query solved but I need some help understanding the logic of this query. NOTE: VENDORS table and INVOICES table are related by the VENORS_ID column, which is a foreign key in the INVOICES table.

Update the default_terms_id column for the vendors table who have credit account yet there were no payment on the system to match the terms_id column in invoices table

1. You will hardcode the default_terms_id in the update statement. But you need to write first a select query to show only the records that will be changed.

2. Update records (two update queries)

3. Use select statement to show the updated records (VENDORS.vendor_name, VENDORS.default_terms_id, INVOICES.terms_id, INVOICES.invoice_number, INVOICES.invoice_total, INVOICES.credit_total, INVOICES.payment_total)

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_2

Step: 3

blur-text-image_3

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

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

Students also viewed these Databases questions