Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write n SQL statement to list all cities and states of vendor addresses. Make sure the result does not include duplicates. 2. Write n

Capture.JPG102520.JPG


1. Write n SQL statement to list all cities and states of vendor addresses. Make sure the result does not include duplicates. 

2. Write n SQL statement to list the item ID, item description and item cost of all items with a cost between $600 and $700. 

3. Write n SQL statement to list the first and last names of vendor contacts and their associated fax numbers, for all vendors who have a fax number listed in the table. Sort the result in order by last, then first name.

 4. Write n SQL statement to list the minimum, maximum, and average item cost of all items that are priced greater than $1500. 

5. Write n SQL statement to list the item IDs and descriptions of all items whose description starts with "Antique". 

7. Write n SQL statement to count the number of items that are associated with the vendor General Antiques. 

8. Write n SQL statement to list LastName, FirstName, and Phone of the customers who made the purchase with SaleIDs 1, 2, and 3. Use a subquery. 

9. Write n SQL statement to list LastName, FirstName, and Phone of the customers who made the purchase with SaleIDs 1, 2, and 3. Use a join with JOIN ON syntax.

 10.Write n SQL statement to show the average item cost for each vendor. The output should list vendor company names, vendor phone numbers, and the average item cost. 

11.Write n SQL statement to show the sum of SubTotal for each customer. The output should list CustomerID, LastName, FirstName, Phone, and the sum of SubTotals for each customer. Sort the results by Last Name, in descending order. 

12.Write n SQL statement to show all items and (if any) the customers who have purchased them. The output from this statement should include all items, including those that have not been purchased by a customer. The SQL statement output should list ItemID, ItemDescription, CustomerID, LastName, FirstName. 

13.Write n SQL statement to show the first and last names of employees who have sold items obtained from the vendor Linens and Things. 

14.Write n SQL statement to show the average sale totals for sales made to customers by city. In other words, the results should show one line per city, and for each city it should also list the average sale total for that city. 

15.Write n SQL statement to show the minimum, average, and maximum total for sales made in February 2015.
 

VENDOR VendorID CompanyName ContactLastName ContactFirstName Address City State ITEM ItemID ItemDescription PurchaseDate ItemCost ItemPrice EMPLOYEE EmployeeID LastName FirstName Phone Email VendorID ZIP Phone Fax Email SALE ITEM Sale!D SaleltemID ItemID ItemPrice SALE Sale!D Customers EmployeelD SaleDate SubTotal Tax Total CUSTOMER 8 Customer D LastName FirstName Address City State ZIP Phone Email

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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Databases questions

Question

=+c) Would you use this model? Explain.

Answered: 1 week ago