Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

SQL 1.Select Product ID, name, and size of all products with a size of S, M, or

ID: 3855379 • Letter: S

Question

SQL

1.Select Product ID, name, and size of all products with a size of S, M, or L sort the results by name. (Production.Product)

2.Select Sales Order ID, order date, subtotal, and total for all orders with a total amount due between 5000 dollars and 9,999.99 sort the results by order date. (Sales.SalesOrderHeader)

3.Select all currency which use the word dollar in the currency name and which are not 'US dollar'(Sales.Currency 14)

4.Show all sales person who have been assigned a sales quota and also have got bonus of more than $3000(Sales.SalesPerson 9)

5. Show all the stores which have sales person with id 275 or 282 or 288 or 277 or 290(Sales.Store 307)

6.Show all the bike stores worked by sales person id 282 or 275.(eg. a bike store will have the word bike in the name)(Sales.Store 40)

7. For all products which are listed for less than $20 create a list which shows the name product number in one column. (Production.product 215). For Example if the product is id=922 the result will show Road TIre Tube - TT-R982

8. Show all products which start selling within 2 days of june 1, 2002.( Production.Product 211)

9. Show all products that we start selling in June and may.( Production.Product 211)

10 .Show the maximum list price, average list price, maximum standard cost and minimum standard cost. Make sure all columns have a headings.(Production.Product 1)

Explanation / Answer

As per rules I acn answer only first 4 question.To get the answer of other questions plz repost again.

Ans 1)

Select ProductID, name,size
from Production.Product
where size in ('S', 'M', 'L')
order by name ASC;

or

Select ProductID, name,size
from Production.Product
where size in ('S', 'M', 'L')
order by name desc;

Ans 2)

Select SalesOrderID, OrderDate, SubTotal, TotalDue
from Sales.SalesOrderHeader
where TotalDue between '5000' and '9999.99'
order by order date ASC;

or

Select SalesOrderID, OrderDate, SubTotal, TotalDue
from Sales.SalesOrderHeader
where TotalDue between '5000' and '9999.99'
order by order date desc;

Ans 3)

select currency_name
from( Select currency_name from Sales.Currency
where currency_name Like '%dollar%')
where currency_name not like '%US dollar%';

Ans 4)

select * from Sales.SalesPerson
where sales quota is not null
and Bonus >3000;

Ans 5)

select Name from Sales.Store
where SalesPersonID in ('275', '282' ,'288' , '277' , '290');


Ans 6)

select Name from Sales.Store
where SalesPersonID in ('275', '282')
and Name like '%bike%' ;