Вы находитесь на странице: 1из 3

5/11/2019 www.csc.villanova.edu/~jkramer/BakeryER.

html

Bakery Entity Relationship Model


This diagram and description are meant to explain the structure of our bakery database.

Entity-Relationship Diagram

Entity-Relationship Dictionary
ITEM Entity

This entity represents the different bakery treats that are offered on this website. This entity is
involved in the following relationships:

1. An item is requested by zero or more orders, but an individual order only requests one
particular item.

Attributes:

Item #
www.csc.villanova.edu/~jkramer/BakeryER.html 1/3
5/11/2019 www.csc.villanova.edu/~jkramer/BakeryER.html

Name
Description
Price: the unit price for this item
Wholesale Min: the amount of this item required for an order to be considered wholesale

CUSTOMER Entity

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.

Attributes:

Customer ID
Name
Email
Password
Phone #

PAYMENT Entity

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.

Attributes:

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.

PURCHASE Entity

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.

Attributes:

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.

www.csc.villanova.edu/~jkramer/BakeryER.html 2/3
5/11/2019 www.csc.villanova.edu/~jkramer/BakeryER.html

ORDER Entity

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.

Attributes:

Order #
Quantity: The amount of this item that will be included in a purchase.

WHOLESALE Entity

This is a subentity of Order. It provides the option for a discount when a large quantity of a
particular item is ordered.

Attributes:

Discount: The markdown of an item's price if a large quantity is ordered.

PICKUP Entity

This is a subentity of Purchase. It specifies that the customer will be coming to retrieve their
purchase.

Attributes:

Branch #: The bakery branch where the purchase will be picked up.

DELIVERY Entity

This is a subentity of Purchase. It specifies that a purchase will be brought to the customer.

Attributes:

Contact (Name, Phone #): The person responsible for receiving the delivery.
Address: The delivery location.

www.csc.villanova.edu/~jkramer/BakeryER.html 3/3

Вам также может понравиться