SELECT * FROM SKU_DATA ORDER BY Buyer;
SELECT * FROM SKU_DATA ORDER BY Buyer, Department;
SELECT * FROM SKU_DATA ORDER BY Buyer, Department DESC;
SELECT * FROM SKU_DATA WHERE SKU BETWEEN 200000 AND 300000 ORDER BY Department, SKU_Description DESC;
SELECT * FROM SKU_DATA WHERE Buyer BETWEEN 'D' AND 'K' ORDER BY Department, SKU_Description DESC;
SELECT * FROM SKU_DATA WHERE Buyer >= 'D' AND BUYER <= 'K' ORDER BY Department, SKU_Description DESC;
SELECT * FROM SKU_DATA WHERE BUYER LIKE "N%";
SELECT * FROM SKU_DATA WHERE SKU LIKE "%1%";
SELECT * FROM SKU_DATA WHERE SKU_DESCRIPTION LIKE "%_, %";
SELECT * FROM SKU_DATA WHERE Buyer LIKE "P_te %";
SELECT Buyer AS Person FROM SKU_DATA;
SELECT Buyer AS Person FROM SKU_DATA ORDER BY Person;
SELECT SUM(QuantityOnHand) FROM INVENTORY; SELECT SUM(QuantityOnHand) AS "Total Items" FROM INVENTORY; SELECT AVG(QuantityOnHand) AS "Average" FROM INVENTORY; SELECT AVG(QuantityOnHand) AS "Average" FROM INVENTORY WHERE QuantityOnHand > 0; SELECT SUBSTRING(Buyer,POSITION(' ' IN Buyer)) FROM SKU_DATA; SELECT DISTINCT SUBSTRING(Buyer,POSITION(' ' IN Buyer)+1) AS LastName FROM SKU_DATA ORDER BY LastName; SELECT COUNT(*) AS "Cindy's Items" FROM SKU_DATA WHERE Buyer LIKE "% Lo"; SELECT SKU, Buyer FROM SKU_DATA WHERE Substring(Buyer,Position(' ' IN Buyer)+1)="Lo" ORDER BY SKU;
SELECT COUNT(*),SKU FROM SKU_DATA;
SELECT SKU,Buyer FROM SKU_DATA WHERE Count(Substring(Buyer,Position(' ' IN Buyer)+1)) > 2;
SELECT DISTINCT CONCAT(Department,": ", Buyer) AS "Department/Buyer" FROM SKU_DATA; SELECT SKU, QuantityOnHand, QuantityOnOrder, QuantityOnHand + QuantityOnOrder AS "Count Total" FROM INVENTORY; SELECT Quantity, Price, Quantity*Price, ExtendedPrice FROM ORDER_ITEM; SELECT Quantity, Price, Quantity*Price , ExtendedPrice FROM ORDER_ITEM WHERE Quantity*Price = ExtendedPrice;