Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help with these problems Instructions: Solve the following questions and submit the SQL solutions in a single sql file. Please follow the submission guideline

please help with these problems image text in transcribed
image text in transcribed
Instructions: Solve the following questions and submit the SQL solutions in a single sql file. Please follow the submission guideline and prefix each solution with Bepr oblem number, even for skipped problem (in that case, add another line-not attempted below the prefix line). All problems are based off database AP. Execute create_db_op.sql to create the DB before you start to work on the problems. . For eac h problem: full credit is given only if the query executes without syntax error and outputs the specified columns with correct information. Partial credit is considered if the developed query has the correct logic but with mistakes. Sample outputs are given for some of the problems, however they may not contain all the rows. y all invoices with balance due $200 or more (after payments and credits). Return invoice number, date of invoice, and amount due. Sort by the balance due amount in d escending order. 2) Display invoice ID, payment_total, and invoice_due_date from the invoices table where the payment_total is larger than 100 and invoice_due_date is earlier than Aug 15 2014.Sort by payment total in descending order 3) Display vendor contact information as it appears below. Display only vendors from state of Pennsylvania (PA). Create proper aliases for name, and the phone number> column headings. chint: use CONCAT of first name, last Vendor Contact Information Clarence Maeve, Phone: (215) 555-8700 4) List all the invoices from Federal Express Corporation. Sort by invoice_number. Create proper aliases for column headings to show table as follows Vendor Name Federal Express Corporation 1-200-5164 Federal Express Corporation 1-202-2978 Federal Express Corporation 2-000-2993 Invoice Number 5) Insert a new invoice record into the invoices table. Choose 6) Delete the invoice inserted in Problem 6. You can use the values you have chosen in Problem 6 to locate the record 7) Find the top S line items with the largest ine item,amount that belongs to vendor "Federal Express Corporation. Return the vendor name, invoice number and line, use UMIT 8) List the vendors and how many invoices that belongs to each vendor in descending order as below Number of Involces Vendor Name Federal Express Corporation47 United Parcel Service Zyfka Design 9) List all the invoices where the invoice total is less than the average invoice_t invoice total in descending order and only return rows where the invoice_total is larger than returned table should contain the columns as below: 77290 RTR-72-3662-X 2014-05-25 1600.00 31359783 75C-90227 2014-05-13 1750.00 2014-06-03 1575.00 2014-06-11 1367.50 0545443 10) Find the largest invoice_total for each vendor. Return a table with the vendor name, its largest invoice_ total and the related invoice id. Order the table based on the descending order of the invoice _total. The table should look like below: vendor name Data Reproductions Corp21842.00 43 invoice_total invoice id 37966.19 39 7125.34 Malloy Lithographing Inc Digital Dreamworks 31

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

More Books

Students also viewed these Databases questions

Question

5. Have you stressed the topics relevance to your audience?

Answered: 1 week ago