can someone help me with theses questions. im stuck. This is all in SQL e Secure
ID: 3891087 • Letter: C
Question
can someone help me with theses questions. im stuck. This is all in SQL
e Secure https/bb.fscjedu/webapps/assessment/take/launch sp?course. assessment id 464398 18course.id 913204 1&content; id _6065147 18step-null a? 1. (15 pts) Write a SELECT statement that returns: the Vendor State InvoiceCount: the number of invoices in that state InvoiceAverage: the in that state average invoice total include only the results where the Inwoice Average is more than 500.00. Display in descending order for the invoice Average column. The correct s query and al rows in the results grid solution has 7 rows. Show the full 2. (15 pts) Write a SELECT statement that returns Vendor Name Vendor State VendorSum: the sum of all the invoices for that Vendor VendorMax: the amount of the largest invoice for that vendor Include only the vendors with invoices that have a balance due. Display in descending order of VendarSum. The correct solution has resuits grid 7 rows. Show the full query and alf rows in the S. (15 pts) Write a SELECT statement that returns Vendor Name Vendor State s with a gefuit account number thiat ceresdsto the office Suplies account description. the correct olution hos 8 rows Show the fu query and ail the rows in the results grid 4. (20 pts) Write a SELECT statement that returns Vendor Name - Invoice Number Invoice Line item Amount 0try to display only the records that have an Invoice Line tem Amount that is greater than the Average Invoice Une item Amount Display in descending invoice ine item Amount order. The correct solution hes 20 rows. Show the fui? query ond the first 10 rowsExplanation / Answer
5a.
select * into VendorTest from Vendors where 1 = 1;
5b.
select * from VendorTest;
6a.
insert into VendorTest(VendorID, VendorName, VendorAddress1, VendorAddress2, VendorCity, VendorState, VendorZipCode, VendorPhone, DefaultTermsID, DefaultAccountNo)
SELECT MAX(VendorID)+1, 'Peterbrooke Chocolatier', '4414 Town Center Pkwy', '#219', 'Jacksonville', 'FL', 32246, '(904) 398-2499', 1, 580 FROM VendorTest WITH (ROWLOCK, XLOCK, HOLDLOCK);
6b. select * from VendorTest order by VendorID desc;
7a.
update VendorTest
set VendorName = 'Coco LeMaize'
where VendorID = (SELECT MAX(VendorID) FROM VendorTest)
7b.
select * from VendorTest order by VendorID desc;
8a.
delete from VendorTest
where VendorCity = 'Florida';
8b.
select * from VendorTest order by VendorID desc;
8c.
drop table new_table;
Note: As you have not attached table structure of database. I am not able to solve first 4 answers.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.