1. SQL Basics
Activity 1.01: Inserting Values into the Products Table in the PACKT_ONLINE_SHOP Database
Solution:
- Create the
Products
table with the same column names that were provided in the Excel spreadsheet:use packt_online_shop; CREATE TABLE Products ( Â Â Â Â ProductID INT NOT NULL, Â Â Â Â ProductCategoryID INT NOT NULL, Â Â Â Â SupplierID INT NOT NULL, Â Â Â Â ProductName CHAR(50) NOT NULL, Â Â Â Â NetRetailPrice DECIMAL(10, 2) NULL, Â Â Â Â AvailableQuantity INT NOT NULL, Â Â Â Â WholesalePrice DECIMAL(10, 2) NOT NULL, Â Â Â Â UnitKGWeight DECIMAL(10, 5) NULL, Â Â Â Â Notes VARCHAR(750) NULL, PRIMARY KEY (ProductID) );
- Enter the values into the
Products
table:INSERT INTO Products ( ProductID, ProductCategoryID, SupplierID, ProductName, NetRetailPrice, AvailableQuantity, WholesalePrice, UnitKGWeight, Notes ) VALUES...