Design an Entity-Relationship(ER) Model for an Online Food
Ordering System
1. Problem Statement:
The challenges encountered by the existing system serve as a major drawback to the
realization of efficiency and customer satisfaction. The experience of ordering in most fast
food restaurants is not pleasant for the customers. Customers will have to make long queues
before placing their orders especially during peak hours and then the ordering staff will record
customer orders. Having placed their order, the customer must then wait near the counter until
their order is ready for collection. The other problem in the food service industry is that
restaurants are not realizing the efficiencies that would result from better application of
technology in their daily operations. Fast food business in a very competitive business and one
way to stand out from competitors is through improving the business process where business
process automation can assist business improvement. The other problem with the current
system is that the customers are not able to see the ingredients of the meals before they place
their order and also they only have
System Requirements:
These consist of the hardware and software components of a computer system that are
required to install in order to use the software efficiently.
Software requirements
• Operating system: Windows XP / windows 7
• Technology : PHP
• Database : MySQL
• Tool : Dreamweaver
• Antivirus software
• Backup & Data Recovery software
Hardware requirements
• Processor: Intel dual core or above
• Processor Speed:1.0GHZ or above
• RAM: 1 GB RAM or above
• Hard Disk: 20 GB hard disk or above
• Printer for printing reports
• Uninterruptible power supply to ensure a constant access of data.
• USB flash disk( At least 2GB
2. Identify Entities:
Here is a list of the main entities based on the system requirements:
1. Customer
2. Restaurant
3. MenuItem
4. Order
5. OrderItem (junction table for many-to-many relationship)
6. Payment
7. Delivery
8. DeliveryAgent
9. Review
10. Offer
Identify Attributes:
Customer
• CustomerID(PK)
• Name
• Email(Unique)
• Phone
• Password
• DefaultAddress
Restaurant
• RestaurantID(PK)
• Name
• Email
• Phone
• Address
• CuisineType
• Rating(derived from reviews
MenuItem
• ItemID(PK)
• RestaurantID(FK)
• Name
• Description
• Category(e.g., Main, Starter)
• Price
• IsAvailable(Boolean)
Order
• OrderID(PK)
• CustomerID(FK)
• RestaurantID(FK)
• OrderDateTime
• Status(Pending, Preparing, Delivered, etc.)
• TotalAmount
• DiscountApplied
• FinalAmount
• DeliveryAddress
OrderItem
• OrderID(PK, FK)
• ItemID(PK, FK)
• Quantity
• PriceAtOrderTime
• AppliedOfferID(FK, nullable)
Payment
• PaymentID(PK)
• OrderID(FK)
• PaymentMethod
• PaymentStatus(Completed, Failed)
• TransactionDateTime
• AmountPaid
Delivery
• DeliveryID(PK)
• OrderID(FK)
• DeliveryAgentID(FK)
• Status(Picked Up, In Transit, Delivered)
• EstimatedDeliveryTime
• ActualDeliveryTime
DeliveryAgent
• DeliveryAgentID(PK)
• Name
• Phone
• VehicleDetails
• CurrentStatus(Available, On Delivery)
Review
• ReviewID(PK)
• CustomerID(FK)
• RestaurantID(FK)
• Rating(1–5)
• Comment
• ReviewDate
Offer
• OfferID(PK)
• OfferName
• DiscountType(Flat, Percentage)
• DiscountValue
• ValidFrom
• ValidTo
• AppliesTo(ENUM: Item, Restaurant)
• ItemID(FK, nullable)
• RestaurantID(FK, nullable)
Define Relationships:
Relationship Type Explanation
Customer – Order One → Many One customer can place many orders
Order – OrderItem One → Many One order has many items
OrderItem – MenuItem Many → One Each order item is a menu item
MenuItem – Restaurant Many → One Each item belongs to a restaurant
Order – Payment One → One Each order has one payment
Order – Delivery One → One Each order has one delivery
Delivery – DeliveryAgent Many → One One agent can handle many deliveries
Customer – Review – Restaurant Many → Many A customer can review many restaurants
MenuItem – Offer One → One or Items may have an offer
Many → One
Draw the ER -Diagram: