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...