Question: 2. Declare a table variable called Yendory. In that table, Insert the following data which should be generated with a query that joins the Vendors

 2. Declare a table variable called "Yendory". In that table, Insert
the following data which should be generated with a query that joins
the Vendors & Involces tables with aggregate functions and group by, where

2. Declare a table variable called "Yendory". In that table, Insert the following data which should be generated with a query that joins the Vendors & Involces tables with aggregate functions and group by, where county is the number of invoices of each vendor and total is the PaymentTotal of each vendor. Refer to lecture WK3-Ch14-scripts(2) Slide3. Then write a select query to display the data from the Vendory table variable to look like the following table. Some numbers in the total column may not match with yours. 2. Declare a table variable called "Vendory". In that table, Insert the following data which should be generated with a query that joins the Vendors & Invoices tables with aggregate functions and group by, where county is the number of Involces of each vendor and total is the PaymentTotal of each vendor. Refer to lecture WK3-Ch14-scripts(2) Slide#3. Then write a select query to display the data from the Vendory table variable to look like the following table. Some numbers in the total column may not match with yours. vname Federal Express Corporation United Parcel Service Zylka Design Pacific Bell Malloy Lithographing Inc Roadway Package System Inc Blue Cross Cardinal Business Media, Inc Compuserve Data Reproductions.com IBM Ingram county total 47 4167.13 9 23177.96 8 6740.25 6 171.01 5 86069.22 4 43.67 13 340.00 2 125.00 2 19.90 2 21842.00 2 1200.12 12 1575.00 19 WK3-Exercise Submit on Canvas as a sql file under Assignments > WK3. Due Date: Sunday, Jan 31 by 11p. 1. Exercise 1 from Chapter 14 of the book. Refer to lecture WK3-C14-Scripts() Slide#9. Write a script that declares and scts a variable equal to the total outstanding balance due in the invoices table (TotalDue) If the outstanding balance due is less than 10,000, the script should display the message "Balance due is less than $10,000 If the outstanding balance due is greater than $10,000, the script should display a result set (the table below) consisting of Vendor Name. InvoiceNumber, InvoiceDucDate and the Balance (Invoice Total - Payment Total - Credit Tocal) for each invoice with a balance due, in other words, with a balance greater than 0. Sort result such that the carliest due date appears first De 9300 2000 220 Foral Corp.33 1932 Cuma BM03416 1702 Toderal Caption 2400 Federal Con 1200 Fodral Expert Corporate 2253273 42012 Malle Tedd 4700 Millegi 2. Declare a table variable called "vendor". In that table.insert the following data which should be generated with a query that joins the Vendors & Invoices tables with aggregate functions and group by, where county is the number of invoices of each vendor and total is the Payment Total of each vendor Refer to lecture WK3-C4-script:2) Slide 3 Then write a select query to display the data from the Vendor V table variable to look like the following table. Some numbers in the total column may not match with your Pode ape Cape 17.01 2 ed Mually be the ima Ready Pudrytem, bet Central en Mirre! 1950 De RC2132 3. Write a script that attempts to insert a new vendor in the Vendors table make up the vendor data). If the intention is successful, the script should display this message: SUCCESS: Record was inserted. If the insertion is unsuccessful, the script should display a message something like this: FAILURE: Record was not inserted. Errer_NUMBER : Some error message Refer to lecture WK3-Ch14scripts/2) Slide

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!