Here is an Entity-Relationship Diagram for the canteen application:
Entities:
1. Customer
2. Order
3. Menu Item
4. Payment
Relationships:
1. Customer places Order (1 to many)
2. Order contains Menu Item (many to many)
3. Order has Payment (1 to 1)
Cardinality:
- Customer can place multiple Orders, but each Order is placed by only one Customer. (1 Customer: many Orders)
- Each Order can contain multiple Menu Items, and each Menu Item can be part of multiple Orders. (many Orders: many Menu Items)
- Each Order has only one Payment, and each Payment belongs to only one Order. (1 Order: 1 Payment)
Primary Keys:
- Customer: Customer ID
- Order: Order ID
- Menu Item: Menu Item ID
- Payment: Payment ID
Foreign Keys:
- Order: Customer ID (refers to Customer entity)
- Order: Menu Item ID (refers to Menu Item entity)
- Payment: Order ID (refers to Order entity)
Attribute:
- Menu Item: Price (other than primary or foreign key)
Create an Entity‐Relationship Diagram that will show the relationship between the
entities that will be present in the canteen application. Your diagram should
indicate the following:
Cardinality
Primary Keys
Foreign Keys
At least one attribute other than the primary or foreign key.
1 answer