0% found this document useful (0 votes)
17 views4 pages

Dbms Group CIA 3

Uploaded by

vanshika29tandon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views4 pages

Dbms Group CIA 3

Uploaded by

vanshika29tandon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

TABLE 1

CREATE TABLE Customers (


CustomerID INT PRIMARY KEY,
Name VARCHAR(50) NOT NULL,
Email VARCHAR(50) NOT NULL,
Phone INT NOT NULL
);

INSERT INTO Customers (CustomerID, Name, Email, Phone)


VALUES (1, 'John Doe', '[email protected]', 7651234);
INSERT INTO Customers (CustomerID, Name, Email, Phone)
VALUES (2, 'Jane Smith', '[email protected]', 5551235);
INSERT INTO Customers (CustomerID, Name, Email, Phone)
VALUES (3, 'Bob Johnson', '[email protected]', 5551236);
INSERT INTO Customers (CustomerID, Name, Email, Phone)
VALUES (4, 'Alice Lee', '[email protected]', 5551237);

TABLE 2
CREATE TABLE Orders (
OrderID INT PRIMARY KEY,
CustomerID INT NOT NULL,
OrderDate DATE NOT NULL,
TotalCost DECIMAL(10, 2) NOT NULL,
FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)
);

INSERT INTO Orders (OrderID, CustomerID, OrderDate, TotalCost)


VALUES (1002, 1, '2023-04-14', 49.99);
INSERT INTO Orders (OrderID, CustomerID, OrderDate, TotalCost)
VALUES (1003, 1, '2023-04-14', 120.75);
INSERT INTO Orders (OrderID, CustomerID, OrderDate, TotalCost)
VALUES (1004, 1, '2023-04-14', 89.99);
INSERT INTO Orders (OrderID, CustomerID, OrderDate, TotalCost)
VALUES (1005, 1, '2023-04-14', 150.50);
INSERT INTO Orders (OrderID, CustomerID, OrderDate, TotalCost)
VALUES (1006, 1, '2023-04-14', 35);

TABLE 3
CREATE TABLE Products (
ProductID INT PRIMARY KEY,
Product_Name VARCHAR(50) NOT NULL,
Price DECIMAL(10, 2)
);

INSERT INTO Products (ProductID, Name, Price) VALUES (1, 'Croissant', 2.50);
INSERT INTO Products (ProductID, Name, Price) VALUES (2, 'Baguette', 3.50);
INSERT INTO Products (ProductID, Name, Price) VALUES (3, 'Muffin', 1.50);
INSERT INTO Products (ProductID, Name, Price) VALUES (4, 'Cinnamon Roll', 2.25);
INSERT INTO Products (ProductID, Name, Price) VALUES (5, 'Chocolate Croissant',
3.00);
INSERT INTO Products (ProductID, Name, Price) VALUES (6, 'Pain au Chocolat', 3.50);
INSERT INTO Products (ProductID, Name, Price) VALUES (7, 'Danish', 2.75);
INSERT INTO Products (ProductID, Name, Price) VALUES (8, 'Scone', 2.25);
INSERT INTO Products (ProductID, Name, Price) VALUES (9, 'Cinnamon Bagel', 2);

TABLE 4
CREATE TABLE OrderDetails (
OrderDetailID INT PRIMARY KEY,
OrderID INT NOT NULL,
ProductID INT NOT NULL,
Quantity INT NOT NULL,
FOREIGN KEY (OrderID) REFERENCES Orders(OrderID),
FOREIGN KEY (ProductID) REFERENCES Products(ProductID)
);

INSERT INTO OrderDetails (OrderDetailID, OrderID, ProductID, Quantity)


VALUES (1, 1002, 1, 2);
Insert Into OrderDetails (OrderDetailID, OrderID, ProductID, Quantity) Values (2,
1003, 2, 1);
INSERT INTO OrderDetails (OrderDetailID, OrderID, ProductID, Quantity) VALUES (3,
1004, 3, 3);
INSERT INTO OrderDetails (OrderDetailID, OrderID, ProductID, Quantity)
VALUES (4, 1005, 4, 1);
INSERT INTO OrderDetails (OrderDetailID, OrderID, ProductID, Quantity)
VALUES (5, 1006, 5, 2);

TABLE 5
CREATE TABLE Employees (
EmployeeID INT PRIMARY KEY,
Name VARCHAR(50) NOT NULL,
Position VARCHAR(50) NOT NULL,
Email VARCHAR(50) NOT NULL,
Phone VARCHAR(20) NOT NULL
);

INSERT INTO Employees (EmployeeID, Name, Position, Email, Phone)


VALUES (1001, 'John Smith', 'Manager', '[email protected]', '123-456-7890'),
(1002, 'Jane Doe', 'Sales Associate', '[email protected]', '234-567-
8901'),
(1003, 'Robert Johnson', 'Marketing Coordinator',
'[email protected]', '345-678-9012'),
(1004, 'Emily Chen', 'Customer Service Representative',
'[email protected]', '456-789-0123'),
(1005, 'Michael Lee', 'Warehouse Associate', '[email protected]',
'567-890-1234');

Table 6
CREATE TABLE Shifts (
ShiftID INT PRIMARY KEY,
EmployeeID INT NOT NULL,
ShiftDate DATE NOT NULL,
StartTime TIME NOT NULL,
EndTime TIME NOT NULL,
FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID)
);

INSERT INTO Shifts (ShiftID, EmployeeID, ShiftDate, StartTime, EndTime)


VALUES (1, 1001, '2023-04-14', '09:00:00', '17:00:00');
INSERT INTO Shifts (ShiftID, EmployeeID, ShiftDate, StartTime, EndTime)
VALUES (2, 1002, '2023-04-14', '12:00:00', '20:00:00');
INSERT INTO Shifts (ShiftID, EmployeeID, ShiftDate, StartTime, EndTime)
VALUES (3, 1003, '2023-04-14', '15:00:00', '23:00:00');
INSERT INTO Shifts (ShiftID, EmployeeID, ShiftDate, StartTime, EndTime)
VALUES(4, 1004, '2023-04-14', '10:00:00', '18:00:00');
INSERT INTO Shifts (ShiftID, EmployeeID, ShiftDate, StartTime, EndTime)
VALUES (5, 1005, '2023-04-14', '11:00:00', '19:00:00');

Table 7
CREATE TABLE Suppliers (
SupplierID INT PRIMARY KEY,
Name VARCHAR(50) NOT NULL,
Email VARCHAR(50) NOT NULL,
Phone VARCHAR(20) NOT NULL
);

INSERT INTO Suppliers (SupplierID, Name, Email, Phone) VALUES (2, 'XYZ Baking
Supplies', '[email protected]', '555-1234');
INSERT INTO Suppliers (SupplierID, Name, Email, Phone) VALUES (3, 'Gourmet Coffee
Roasters', '[email protected]', '555-2345');
INSERT INTO Suppliers (SupplierID, Name, Email, Phone) VALUES (4, 'Fresh Fruit
Distributors', '[email protected]', '555-3456');
INSERT INTO Suppliers (SupplierID, Name, Email, Phone) VALUES (5, 'Bakery Packaging
Solutions', '[email protected]', '555-4567');
INSERT INTO Suppliers (SupplierID, Name, Email, Phone) VALUES (6, 'Specialty Tea
Co.', '[email protected]','555-5678');

Table 8
CREATE TABLE Ingredients (
IngredientID INT PRIMARY KEY,
Name VARCHAR(50) NOT NULL,
SupplierID INT NOT NULL,
FOREIGN KEY (SupplierID) REFERENCES Suppliers(SupplierID)
);

INSERT INTO Ingredients (IngredientID, Name, SupplierID)


VALUES (1, 'Flour', 2);
INSERT INTO Ingredients (IngredientID, Name, SupplierID)
VALUES (2, 'Sugar', 2);
INSERT INTO Ingredients (IngredientID, Name, SupplierID)
VALUES (3, 'Salt', 3);
INSERT INTO Ingredients (IngredientID, Name, SupplierID)
VALUES (4, 'Milk', 4);
INSERT INTO Ingredients (IngredientID, Name, SupplierID)
VALUES (5,'Eggs', 5);

Table 9

CREATE TABLE IngredientStock (


IngredientStockID INT PRIMARY KEY,
IngredientID INT NOT NULL,
Quantity INT NOT NULL,
FOREIGN KEY (IngredientID) REFERENCES Ingredients(IngredientID)
);

INSERT INTO IngredientStock (IngredientStockID, IngredientID, Quantity)


VALUES (1, 1, 10);
INSERT INTO IngredientStock (IngredientStockID, IngredientID, Quantity)
VALUES (2, 2, 20);
INSERT INTO IngredientStock (IngredientStockID, IngredientID, Quantity)
VALUES (3, 3, 30);
INSERT INTO IngredientStock (IngredientStockID, IngredientID, Quantity)
VALUES (4, 4, 40);
INSERT INTO IngredientStock (IngredientStockID, IngredientID, Quantity)
VALUES(5, 5, 50);

TABLE 10
CREATE TABLE ProductIngredients (
ProductID INT NOT NULL,
IngredientID INT NOT NULL,
Quantity INT NOT NULL,
PRIMARY KEY (ProductID, IngredientID),
FOREIGN KEY (ProductID) REFERENCES Products(ProductID),
FOREIGN KEY (IngredientID) REFERENCES Ingredients(IngredientID)
);

INSERT INTO ProductIngredients (ProductID, IngredientID, Quantity)


VALUES (1, 1, 10);
INSERT INTO ProductIngredients (ProductID, IngredientID, Quantity)
VALUES (1, 2, 20);
INSERT INTO ProductIngredients (ProductID, IngredientID, Quantity)
VALUES (2, 3, 30);
INSERT INTO ProductIngredients (ProductID, IngredientID, Quantity)
VALUES (3, 4, 40);
INSERT INTO ProductIngredients (ProductID, IngredientID, Quantity)
VALUES(4, 5, 50);

TABLE 11
CREATE TABLE Reviews (
ReviewID INT PRIMARY KEY,
ProductID INT NOT NULL,
CustomerID INT NOT NULL,
Rating INT NOT NULL,
Comment TEXT,
FOREIGN KEY (ProductID) REFERENCES Products(ProductID),
FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)
);

INSERT INTO Reviews (ReviewID, ProductID, CustomerID, Rating, Comment)


VALUES (1, 1, 1, 4, 'Great product, highly recommend!');
INSERT INTO Reviews (ReviewID, ProductID, CustomerID, Rating, Comment)
VALUES (2, 2, 2, 3, 'Decent product, but could use some improvements.');
INSERT INTO Reviews (ReviewID, ProductID, CustomerID, Rating, Comment)
VALUES (3, 3, 3, 5, 'Absolutely love this product!');
INSERT INTO Reviews (ReviewID, ProductID, CustomerID, Rating, Comment)
VALUES (4, 4, 4, 2, 'Disappointed with the quality.');
INSERT INTO Reviews (ReviewID, ProductID, CustomerID, Rating, Comment)
VALUES (5, 5, 5, 4, 'Good value for the price.');

You might also like