Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribedimage text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago