CC 4057
CC 4057
CC 4057
Systems
Lab work – week 2
1. Create a database named “MyStore”.
2. Create a table named “suppliers” in the database with the following fields:
supplierID INT PRIMARY KEY
name VARCHAR(255)
address VARCHAR(255)
phone VARCHAR(255)
3. Create a table named “products” in the database with the following fields:
productID INT PRIMARY KEY
product_code VARCHAR(255)
name VARCHAR(255)
quantity INT
price INT
supplier INT FOREIGN KEY
*The foreign key supplier should reference the supplier_ID field of the
suppliers table.
4. Insert data into the “suppliers” table
supplierID name address phone
1 Adidas Lalitpur 889-22-12
2 Nivea Pokhara 686-48-34
3 CG Kathmandu 950-43-11
5. Insert data into the “products” table
productID product_code name quantity price supplier
1 p001 waiwai 10000 20 3
2 p002 cream 2000 200 2
3 p003 shirt 2500 600 1
4 p004 pant 5000 1200 1
5 p005 tv 50000 50000 3