The statement CREATE VIEW view_sa3ASSELECT vendor_name, AVG(…
The statement CREATE VIEW view_sa3ASSELECT vendor_name, AVG(invoice_total) AS avg_of_invoicesFROM vendors JOIN invoices ON vendors.vendor_id = invoices.vendor_idGROUP BY vendor_nameHAVING AVG(invoice_total)>21ORDER BY vendor_name;
Read DetailsWhen this query is executed, the result set will contain SEL…
When this query is executed, the result set will contain SELECT vendor_name, COUNT(*) AS number_of_invoices, AVG(invoice_total – payment_total – credit_total) AS balance_due FROM vendors v JOIN invoices i ON v.vendor_id = i.vendor_id WHERE (invoice_total – payment_total – credit_total) >= (SELECT AVG(invoice_total – payment_total – credit_total) FROM invoices) GROUP BY vendor_name ORDER BY balance_due DESC;
Read DetailsWhen this query is executed, the result table will contain o…
When this query is executed, the result table will contain one row for SELECT i.vendor_id, MIN(i.invoice_total) AS smallest_invoiceFROM invoices i JOIN (SELECT vendor_id, AVG(invoice_total) AS average_invoice FROM invoices GROUP BY vendor_id HAVING AVG(invoice_total) >=88) vendors_temp ON i.vendor_id = vendors_temp.vendor_idGROUP BY i.vendor_idORDER BY smallest_invoice;
Read Details