Assignment Database No.4
Assignment Database No.4
Product
Schema : Product( ProductID, ProductName, Category, Price, StockQuantity, SupplierID )
Supplier
Schema : Supplier( SupplierID, SupplierName, ContactName, ContactEmail, ContactPhone )
Customer
Schema : ( CustomerID, CustomerName, Email, Phone, ShippingAddress )
Order
Schema : Order( OrderID, OrderDate, TotalAmount, CustomerID, StoreID, SalesPersonID )
OrderDetails
Schema : OrderDetails( OrderDetailsID, OrderID, ProductID, Quantity, PriceAtTimeOfOrder)
Payment
Schema : Payment( PaymentID, OrderID, PaymentMethod, PaymentDate, AmountPaid )
Store
Schema : Store( StoreID, StoreName, StoreLocation, ManagerName )
SalesPerson
Schema : SalesPerson( SalesPersonID, SalesPersonName, StoreID, Email, Phone)
The Tables I have created as the database name is Assignment and the tables are Customer,
Employee, Order, OrderDetails, Payment, Product, Shipment, Supplier.
6) Sample Records
Customer Table
Supplier Table
Product Table
Order Table
Payment Table
Employee Table
Shipment Table
7) SQL Queries
This Picture is about the query that tell “ SELECT * FROM Customer; ” shows the data of the
customer.
This Picture is about the query that tell “SELECT * FROM `Order` WHERE CustomerID =
(SELECT CustomerID FROM Customer WHERE CustomerName = 'John Doe'); ” shows the
order with customer id by the name Jack Daniels.
This Picture is about the query that tell “ ALTER TABLE Shipment ADD COLUMN
TrackingNumber VARCHAR(50); ” shows the shipment table is added an extra column name
TrackingNumber.