Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this question, could you please help how to the following queries using Oracle SQL Database Here is the structure for the invoices table 12.

For this question, could you please help how to the following queries using Oracle SQL Database

image text in transcribed

Here is the structure for the invoices table

image text in transcribedimage text in transcribed

12. A. Report the vendor_ids and a count of invoices for each vendor_id (use table invoices). B. Report the vendor_ids, the invoice month (as Invoice_Month) and a count of invoices for each vendor_id and for each month (use table invoices). Report the average invoice total and the complete payment total again per vendor_id and for each month. Round them all to dollar C. Describe what you see for the vendor with id = 34. Do the results of queries A and B match? D. Now repeat the query of A but restrict your results to only those vendors that have more than 2 invoices. Is this requirement placed in the WHERE clause, the HAVING clause or both? E. Now repeat again the query of A but restrict your results to only those vendors with vendor Id larger than 100. Is this requirement placed in the WHERE clause, the HAVING clause or both? F. Now repeat again the query of A but restrict your results to only those records with invoice total smaller than 100. Is this requirement placed in the WHERE clause, the HAVING clause or both? Columns Data Model Constraints Grants Statistics Triggers Flashback Dependencies Details Partitions Indexes |SQL Actions... NULLABLE DATA_DEFAULT COLUMN_ID COMMENTS COLUMN_NAME DATA_TYPE 1 INVOICE_ID (null) 1 (null) NUMBER No (null) 2 (null) 2 VENDOR_ID NUMBER No 3 (null) VARCHAR2 (50 BYTE) No (null) 3 INVOICE_NUMBER 4 (null) (null) 4 INVOICE_DATE DATE No NUMBER (9,2) NUMBER (9,2) NUMBER (9,2) 5 (null) (null) 5 INVOICE_TOTAL No 6 (null) 7 (null) 6 PAYMENT_TOTAL Yes 7 CREDIT_TOTAL Yes (null) 8 (null) 8 TERMS_ID No NUMBER 9 (null) 9 INVOICE_DUE_DATE (null) DATE No 10 PAYMENT_DATE (null) 10 (null) Yes DATE Columns Data Model Constraints Grants Statistics Triggers Flashback|Dependencies Details Partitions Indexes SQL | Sort.. I Filter: Actions... INVOICE_TOTAL PAYMENT_TOTAL CREDIT_TOTAL TERMS_ID INVOICE_DUE_DATE INVOICE_ID VENDOR_ID INVOICE_NUMBER INVOICE_DATE 34 QP58872 25-FEB-08 116.54 116.54 4 22-APR-08 34 Q545443 14-MAR-08 1083.58 1083.58 4 23-MAY-08 3 20551.18 110 P-0608 11-APR-08 1200 5 30-JUN-08 4 26881.4 4 110 P-0259 16-APR-08 26881.4 3 16-MAY-08 5 936.93 81 MABO1489 16-APR-08 936.93 3 16-MAY-08

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

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions