Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

7) Create a SELECT statement that returns e vendor name invoice number · account

ID: 3724336 • Letter: 7

Question

7) Create a SELECT statement that returns e vendor name invoice number · account-description for all invoices where the balance due is greater than O (invoice minus credit minus payment). Order by both vendor name and line item amount in descending order. Should return 11 rows 2014-07-23 20551.18 201407-31 076.06 2014-07-21 579 Dook Printing Cost Book Printnc Coets 1365833 9982771 Dues and Subsarioions d Motor Credt Comoan Exoress Cororaton 63253270 2014-07-22 67.92 Federal Exoress Cororaon 263253258 2014-07-21 .97 Federal Express Corooration 963253264 Exoress Cororation 263253273 201407-1 522 2014-07-2 307 Data Rearoductions Coro 9104 85.31 Direct Mal Advertising 201407-28 036 2014-08-0 224.00 4748002 8) Create a query that produces the following output (No further explanation should be necessary) Number of Highest Imvoice 37966.19 9) Display the vendor name and average inwoice totals for each vendor that has submitted an invoice where the average invoice total is greater than $1000. Display the average to two decimal points. Sort by average invoice total in descending order. Should get 12 rows. Average Invoice 2397840 125.34 1901.26 2575.33 Diaitsl Dreamworks Parcel Service s Publishing Compa 218450 1750.00 Tax Doard Dean Witer Revold 1367.50 10) Display the number of vendors who submisted an invoice. Nunber of vendors who submtted an

Explanation / Answer

(7)
select
vendor_name,
invoice_number,
invoice_date,
line_item_amount,
amount_description
from <table_name>
where
(<invoice_amount> - <credit_amount> - <payment_amount> > 0)
order by
(vendor_name,
line_item_amount) DESC


(8)
select
count(invoice_number),
MIN(<invoice_amount>),
MAX(<invoice_amount>),
AVG(<invoice_amount>)
from <table_name>


(9)
select
vendor_name,
AVG(<invoice_amount>)
from <table_name>
where
<condition of invoice being submitted>
and AVG(<invoice_amount>) > 1000
group by
vendor_name
order by 2 DESC


(10)
select
count(vendor_name)
from <table_name>
where
<condition of invoice being submitted>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote