Skip to content

COMPLETE THE CODE /*Answer 2*/ — Partial script for the sto

Do you have a similar question? Our professional writers have done a similar paper in past. Give Us your instructions and wait for a professional assignment!        

COMPLETE THE CODE /*Answer 2*/ — Partial script for the stored… COMPLETE THE CODEImage transcription text0.2) (30 points) Develop a stored procedure that will take a state abbreviation as a parameter and list thevendor, total amount still owed on invoices for the vendor, and a count of their invoices (List only vendors towhom a positive amount is still owed; omit vendors to whom no amount is owed). The ELMs assig… Show more… Show more/*Answer 2*/– Partial script for the stored procedure ‘owed_to_state_vendors’– HINT: This stored procedure is built around a SELECT query.– You may want to first build the query, and then plug it into the code below.– See the hints below, right after the BEGIN line, for help with the SELECT query.DROP PROCEDURE IF EXISTS owed_to_state_vendors;DELIMITER //CREATE PROCEDURE owed_to_state_vendors(vendor_state_param VARCHAR(50))BEGIN– –> You need to add a SELECT query here to retrieve the vendor_names from the given state,– — the total amount owed to each of them, and their number of invoices.– — In the query, you will need to JOIN two tables,– — and you will need a filtering condition that will keep only the vendors?- — from the given state, which was passed as the parameter value,– — and you will need to aggregate the total invoice amounts for each vendor,?- — and you will need a filtering condition that will keep only the vendors?- — whose invoice totals are greater than zero.END //DELIMITER ;– –> TEST YOUR CODE:– — Run this statement: CALL owed_to_state_vendors(‘CA’);– — Do your see two rows with the following values?– —?- — ‘Blue Cross’, 224.00, 3– — ‘Ford Motor Credit Company’, 503.20, 1– —?- — If “Yes”, you have built the stored procedure as required;?- — if “No”, continue working on it.– — If you see an extra row from IBM, please re-run your create_databases.sql script?- — as this may show up after completing Question 3.?omputer ScienceEngineering & TechnologyMYSQL INST 733

Get a plagiarism-free order today   we guarantee confidentiality and a professional paper and we will meet the deadline.    

Leave a Reply

Order a plagiarism free paper today. Get 20% off your first order!

X