0% found this document useful (0 votes)
16 views1 page

Qerr

hahahhahahaha

Uploaded by

Lord Genesis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views1 page

Qerr

hahahhahahaha

Uploaded by

Lord Genesis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

SELECT ProductName, QuantityPerUnit FROM Products;

SELECT ProductID, ProductName


FROM Products
WHERE Discontinued = "False"
ORDER BY ProductName;
SELECT ProductID, ProductName
FROM Products
WHERE Discontinued = "True"
ORDER BY ProductName;
Write a query to get most expense and least expensive Product list (name and un
it price).
SELECT ProductName, UnitPrice
FROM Products
ORDER BY UnitPrice DESC;
Write a query to get Product list (name, unit price) where products cost between
$15 and $25.
SELECT ProductName, UnitPrice
FROM Products
WHERE (((UnitPrice)>=15 And (UnitPrice)<=25)
AND ((Products.Discontinued)=False))
ORDER BY Products.UnitPrice DESC;
5. Write a query to get Product list (id, name, unit price) where current produc
ts cost less than $20.
SELECT ProductID, ProductName, UnitPrice
FROM Products
WHERE (((UnitPrice)<20) AND ((Discontinued)=False))
ORDER BY UnitPrice DESC;
8. Write a query to get Product list (name, unit price) of twenty most expensive
products.
SELECT DISTINCT ProductName as Twenty_Most_Expensive_Products, UnitPrice
FROM Products AS a
WHERE 20 >= (SELECT COUNT(DISTINCT UnitPrice)
FROM Products AS b
WHERE b.UnitPrice >= a.UnitPrice)
ORDER BY UnitPrice desc;
10. Write a query to get Product list (name, units on order , units in stock) of
stock is less than the quantity on order.
SELECT ProductName, UnitsOnOrder , UnitsInStock
FROM Products
WHERE (((Discontinued)=False) AND ((UnitsInStock)<UnitsOnOrder));
Structure of Products table :

You might also like