Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with SQL 9. List the names and list prices of products that sold only in a quantity of 2. In other words,

I need help with SQL

9. List the names and list prices of products that sold only in a quantity of 2. In other words, in a quantity of 2 but not in any other quantities.

Hint: You will have to use 2 subqueries in the WHERE clause (not nested). The first subquery will select only those records where quantity is 2. The second subquery will select all those records where quantity is NOT 2. These two subqueries must be true at the same time.

10.

For each sale with non-zero tax, list the saleID and saledate, tax, shipping, the total amount of the sale (all saleitems), and the sum of the tax plus shipping plus total from saleitems. Total amount of the sale is the quantity * saleprice from each saleitem and totaled for the entire sale. Show sales for February 2015. Name the total for each sale "SaleTotal".

Do this using a subquery in the FROM clause. The subquery should list SaleID, and TotalItemAmt.

image text in transcribed

Customer Saleltem Product Manufacturer Customer D - SaleID ProductID FirstName ProductID ProductName Sale SaleID SaleDate CustomerID Tax Shipping Item Size LastName Street Address ManufacturerID Composition ManufacturerID O ManufacturerName Address1 Address2 City Quantity Sale Price ListPrice Gender State City State Postal Code Country Employee PostalCode Category Color EmployeelDO Phone Phone FirstName Fax Description SalaryEmployee Contact URL Employeeld Salary LastName Address City State ZIP Phone ManagerID SSN WageEmployee Employeeld 0 Wage MaxHours Email Address Hire Date

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

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions