(Go back to the exercises.)
None
SELECT
*
FROM
PRODUCTS
WHERE
CATEGORY = 'Household'
SELECT
*
FROM
PRODUCTS
WHERE
PRICE < 200
SELECT DISTINCT
PRODUCT
FROM
PURCHASES
WHERE
SELLER = 'Fred'
ORDER BY
PRODUCT
Single quotes mark the start and end of text, or a "string". Using double quotes or no quotes can result in a SQL error. Try #1.2 with double-quotes around "Household" and see what happens. Then try it again with any quotes.
None
- Add a product,
INSERT INTO PRODUCTS
(PRODUCT, PRICE, CATEGORY, MANUFACTURER)
VALUES
('New Product', 14.99, 'Clothing', 'Fashion, Inc.')
- Verify,
SELECT
*
FROM
PRODUCTS
- Delete,
DELETE
FROM
PRODUCTS
WHERE
PRODUCT = 'New Product'
- Verify using the
SELECT
again
None
SELECT
BUYER,
PRODUCTS.PRODUCT,
PRICE
FROM
PRODUCTS
INNER JOIN PURCHASES
ON PRODUCTS.PRODUCT = PURCHASES.PRODUCT
WHERE
SELLER = 'Fred'
ORDER BY
BUYER
None
None
SELECT
SELLER,
SUM(PRICE) AS GROSS_SALES
FROM
PRODUCTS
INNER JOIN PURCHASES
ON PRODUCTS.PRODUCT = PURCHASES.PRODUCT
GROUP BY
SELLER
HAVING
GROSS_SALES > 100
None