Bakery Entity Relationship Model
This diagram and description are meant to explain the structure of our bakery database.
This entity represents the different bakery treats that are offered on this website. This entity is involved in the following relationships:
- An item is requested by zero or more orders, but an individual order only requests one particular item.
- Item #
- Price: the unit price for this item
- Wholesale Min: the amount of this item required for an order to be considered wholesale
This entity represents a person using the website to make a purchase. The customer purchase relationship can be defined as a customer can place zero or more purchases, while a purchase is placed by exactly one customer. A customer can have zero purchases because it is possible to register for the site but not complete any requests.
- Customer ID
- Phone #
This entity holds the details of the way in which the bill for a purchase is paid. A payment is required by one particular purchase, but a purchase can require one or more payments. This allows customers to pay for purchases in multiple installments.
- Payment #
- Method: if customer paid with cash or credit
- Amount: what portion of the total price is paid in this payment
- Credit (Cardholder Name, Card Number, Company, Expiration, Security Code): an optional attribute. If the customer paid with a credit card, this composite attribute stores the information needed.
This entity connects a customer, their orders, and any payments made. PickUp and Delivery are sub-entities of this super-entity.
- A purchase is placed by exactly one customer, who can place zero or many orders.
- One or more payments are required by a purchase, and these payments can only be associated with one purchase.
- A purchase contains one or more orders. Each order is contained in exactly one entity.
- Purchase ID
- Date: Date that purchase needs to be completed.
- Time: Time that customer will expect their order to be ready or delivered.
- Price: Total price for the combined orders in this purchase.
This entity specifies the quantity of an item needed for a purchase.
- An order is contained in exactly one purchase, but a purchase can contain many orders.
- Each order requests exactly one item. An item can be requested by many orders, but may be requested by no orders.
- Order #
- Quantity: The amount of this item that will be included in a purchase.
This is a subentity of Order. It provides the option for a discount when a large quantity of a particular item is ordered.
- Discount: The markdown of an item's price if a large quantity is ordered.
This is a subentity of Purchase. It specifies that the customer will be coming to retrieve their purchase.
- Branch #: The bakery branch where the purchase will be picked up.
This is a subentity of Purchase. It specifies that a purchase will be brought to the customer.
- Contact (Name, Phone #): The person responsible for receiving the delivery.
- Address: The delivery location.