Answered step by step
Verified Expert Solution
Question
1 Approved Answer
WITH Top5 AS (SELECT TOP 5 VendorID, AVG(InvoiceTotal) AS AvgInvoice FROM Invoices GROUP BY VendorID ORDER BY AvgInvoice DESC) SELECT Invoices. Vendor ID, MAX (Invoices.
WITH Top5 AS (SELECT TOP 5 VendorID, AVG(InvoiceTotal) AS AvgInvoice FROM Invoices GROUP BY VendorID ORDER BY AvgInvoice DESC) SELECT Invoices. Vendor ID, MAX (Invoices. InvoiceTotal) AS LargestInvoice FROM Invoices JOIN Top10 ON Invoices. VendorID = Top10. VendorID GROUP BY Invoices. VendorID ORDER BY LargestInvoice DESC; (Please refer to code example 6-2.) When this query is executed, the result table will contain one row for each vendor each vendor in the Top10 table each invoice each invoice in the Top10 table Question 2 (2.5 points) A union combines the rows from two or more what? SELECT statements result tables queries all of the above Question 3 (2.5 points) Write an aggregate expression to find the VendorName column that's last in alphabetical order MAX(VendorName) SUM(VendorName) COUNT(VendorName) either borc Question 4 (2.5 points) Subqueries can be within other subqueries. restated nested joined grandfathered Question 5 (2.5 points) Which identifier can't be used in a SQL statement? Invoices @Increase [Total Due] email addresses Question 6 (2.5 points) A subquery can be coded in a WHERE, FROM, SELECT, or clause. GROUP BY ORDER BY HAVING FROM Question 7 (2.5 points) Which of the statements below best describes the result set returned by this SELECT statement? SELECT Vendor State, COUNT(*) AS Column2 FROM Vendors GROUP BY Vendor State HAVING COUNT(*) > 1; The names of the vendors in each state The duplicate vendors from each state The number of vendors in each state The number of vendors in each state having more than one vendor
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started