Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you use SQL to report the current date and time; Find the distinct names of the vendors who have invoices with invoice_total larger than

Can you use SQL to report the current date and time;

Find the distinct names of the vendors who have invoices with invoice_total larger than 10,000.

Find all the vendors who have invoices that have not been paid yet. (Hint: the invoice_total will be different than the payment_total).

Rewrite the above query in a total of 3 ways: Using equijoins, using INNER JOIN and using NATURAL JOIN

Find the item titles and the corresponding order ids. B. Now count the number of orders each item has been included in. C. Now report only those items that have been included in more than 5 different orders

Count all the vendor contact first names, then count all the distinct vendor contact first names. Finally, find the vendor contact first names that exist more than once.

Find the order ids for each of the customers whose last name is Blanca

Find all the customers whose last name is Blanca and the order ids for each of their orders

Repeat the query of part 2, This time if there are any NULL values substitute them with 0.

Modify the query of part 7C to get the total order quantities per customer (sum over order_qty per customer). Should you use both first and last name? What would happen if you use only the first name and two customers have the same first name?

Now generalize the query for all customers and check how the number of returned records changes based on whether you are using only the first, only the last or both first and last names.

Find the vendor_name and the invoice_number for the vendors who have invoices, but only for those invoices that have valid invoicelines.

Find the vendor_id and the corresponding invoice_id for the vendors who have invoices, even if these invoices do not have valid invoicelines.

Find the vendor_id and the corresponding invoice_id for all the vendors, even the ones with no invoices, even if these invoices do not have valid invoicelines.

A. Find the name and phone number of each vendor who has a cooperating vendor.

Hint: the vendors for whom the field Cooperating_Vendor_id is not empty

B. Now find additionally the name and phone number of the cooperating vendor. Present these two columns as: cooperating vendor and cooperating vendor phone.

C. Modify the above query to report all vendors. If they are have a cooperating vendor, report their name if not report N/A.

Find the order date for all the orders of customers who leave in Los Angeles using joins

Repeat the same query this time using non-correlated subqueries

Repeat the same query this time using correlated subqueries with the IN statement

Repeat the same query this time using WHERE EXISTS

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

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

State the three basic assumptions of monopolistic competition.

Answered: 1 week ago