Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL Consider the query shown SELECT vendor_state, vendor_city COUNT) AS invoice_qty ROUND(AVG(invoice_total),2) AS invoice_avg FROM invoices JOIN vendors ON invoices.Vendor id=vendors.vendor id GROUP BY vendor_state,

SQL

image text in transcribed

Consider the query shown SELECT vendor_state, vendor_city COUNT) AS invoice_qty ROUND(AVG(invoice_total),2) AS invoice_avg FROM invoices JOIN vendors ON invoices.Vendor id=vendors.vendor id GROUP BY vendor_state, vendor_city HAVING COUNT(*) >= 2 ORDER BY vendor_state, vendor city Could the HAVING clause be replaced by a WHERE clause and still get the same result set? Yes. WHERE can be used instead of HAVING in all cases No. The WHERE clause is applied before the GROUP BY is done, and before the aggregate functions are computed Yes. WHERE can be used instead of HAVING is some cases, and it works in this case O No. The WHERE clause filters rows from a result set while the HAVING clause prevents rows from every being selected into a result set

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

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

What is empathy? Describe how it is related to prejudice.

Answered: 1 week ago