0% found this document useful (0 votes)
20 views5 pages

Er Diagrams

The document outlines the data model for a customer and manager perspective, detailing entities such as Customer, Order, Product, and Manager, along with their attributes and primary/foreign keys. It describes the relationships and cardinality between these entities, indicating how customers place orders, managers manage products, and the interactions between orders and payments. Additionally, it highlights the stock management and reporting functions associated with the manager role.

Uploaded by

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

Er Diagrams

The document outlines the data model for a customer and manager perspective, detailing entities such as Customer, Order, Product, and Manager, along with their attributes and primary/foreign keys. It describes the relationships and cardinality between these entities, indicating how customers place orders, managers manage products, and the interactions between orders and payments. Additionally, it highlights the stock management and reporting functions associated with the manager role.

Uploaded by

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

Customer Perspective: Pk – Primary key , Fk – foreign key

Entities and Attributes:


1. Customer:
o PK: CustomerID
o Attributes: Name, Email, Phone, Address

2. Order:
o PK: OrderID
o FK: CustomerID (references Customer)
o Attributes: OrderDate, TotalAmount, Status

3. OrderDetails :
o PK: OrderDetailsID
o FK: OrderID (references Order)
o FK: ProductID (references Product)
o Attributes: Quantity, PricePerUnit, Discount

4. Product:
o PK: ProductID
o Attributes: ProductName, Price, Category, StockQuantity

5. Payment:
o PK: PaymentID
o FK: OrderID (references Order)
o Attributes: PaymentMethod, PaymentAmount, PaymentStatus

Relationships and Cardinality:


1. Customer places Order:
o Cardinality: 1-to-Many (One customer can place many orders).
o PK: CustomerID (in Customer)
o FK: CustomerID (in Order)

2. Order contains OrderDetails:


o Cardinality: 1-to-Many (One order can contain multiple order details).
o PK: OrderID (in OrderDetails)

3. OrderDetails refers to Product:


o Cardinality: Many-to-1 (Many order details can refer to one product).
o PK: ProductID (in Product)

4. Order has Payment: Cardinality: 1-to-1 (One order has one payment) , PK: PaymentID (in Payment).
Manager Perspective
Entities and Attributes:
1. Manager:
o PK: ManagerID
o Attributes: Name, Email, Phone
2. Product:
o PK: ProductID
o FK: SupplierID (references Supplier)
o FK: ManagerID (references Manager)
o Attributes: ProductName, Price, QuantityAvailable, Category
3. Stock:
o PK: StockID
o FK: ProductID (references Product)
o Attributes: ReorderLevel, CurrentQuantity, LastUpdated
4. Order:
o PK: OrderID
o FK: ManagerID (references Manager)
o Attributes: OrderDate, TotalAmount, Status
5. Report:
o PK: ReportID
o FK: ManagerID (references Manager)
o Attributes: ReportType, GeneratedOn, Content
6. Supplier:
o PK: SupplierID
o Attributes: SupplierName, ContactInfo

Relationships and Keys:


1. Manager manages Product (1-to-Many):
o PK: ManagerID (in Manager)
o FK: ManagerID (in Product)
2. Manager generates Report (1-to-Many):
o PK: ManagerID (in Manager)
o FK: ManagerID (in Report)
3. Product is in Stock (1-to-1):
o PK: ProductID (in Product)
o FK: ProductID (in Stock)
4. Product is supplied by Supplier (Many-to-One):
o PK: SupplierID (in Supplier)
o FK: SupplierID (in Product)
5. Manager oversees Orders (1-to-Many):
o PK: ManagerID (in Manager)
o FK: ManagerID (in Order)

6. Product is part of Order (Many-to-Many):


o One Order can contain multiple Products.
o One Product can be part of multiple Orders.

You might also like