Database Chapter 5

Insert a single record with the default columns.

INSERT INTO products.products VALUES
('FCP008','First Cold Press', 1,8,8.99)
;

Insert multiple records with the default columns.

INSERT INTO products.products VALUES
    ('BI008','Basil-Infused EVO', 2, 8, 10.99),
    ('GI016','Garlic-Infused EVO', 2, 16, 15.99)
;

Insert with named columns.

INSERT INTO products.products
    (SKU, ProductName, Price)
VALUES
    ('OGEC004', 'Olive Glow Eye Cream', 18.99)
;

Update fields for a specific row.

UPDATE products.products
SET CategoryID = 3,
    Size = 4
WHERE SKU = 'OGEC004';

Delete a specific row.

DELETE FROM products.products
WHERE SKU = 'OGEC004';

Leave a Reply

Your email address will not be published. Required fields are marked *