The statement CREATE VIEW my_view_sa2ASSELECT vendor_name, MAX(invoice_total) AS max_of_invoicesFROM vendors JOIN invoices ON vendors.vendor_id = invoices.vendor_idGROUP BY vendor_nameHAVING MAX(invoice_total)>199ORDER BY vendor_name;
Blog
When this query is executed, the rows will be sorted by SEL…
When this query is executed, the rows will be sorted by SELECT vendor_name, COUNT(*) AS number_of_invoices, MAX(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
Which query would run on the following view and will count a…
Which query would run on the following view and will count all vendors from “CA” or “Michigan”:create view my_view_SA2 ASSELECT *FROM vendorsWHERE vendor_state IN (“CA”, “MI”);
What is this query doing:SELECT vendor_id, CASE WHEN default…
What is this query doing:SELECT vendor_id, CASE WHEN default_account_number = 452 THEN “green” WHEN default_account_number = 440 THEN “red” WHEN default_account_number = 303 THEN “green” WHEN default_account_number = 472 THEN “red” WHEN default_account_number = 294 THEN “red” END AS delay_flagsFROM vendors;
When you use WHERE in a query, code in the WHERE part
When you use WHERE in a query, code in the WHERE part
How many groups will this statement create and what is the g…
How many groups will this statement create and what is the group size for 121 customers? NTILE(6) OVER (ORDER BY SUM(TotalAmount)) AS AvgGroup
What is the result of this query? SELECT *, IF(vendor_state…
What is the result of this query? SELECT *, IF(vendor_state regexp “CA” and vendor_contact_first_name regexp “Bob”, “Yes”, “No”) AS new_jersey_Bob_to_trackFROM vendors;
If you run this query, the number_of_invoices for each row w…
If you run this query, the number_of_invoices for each row will show the number SELECT vendor_name, COUNT(*) AS number_of_invoices, MIN(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
Three topic areas are mandated continuing education every 2-…
Three topic areas are mandated continuing education every 2-year renewal cycle. Which of the following is not mandated?
A dentist may legally discontinue treatment of a patient
A dentist may legally discontinue treatment of a patient