Answered step by step
Verified Expert Solution
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
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 setStep 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