Presentation is loading. Please wait.

Presentation is loading. Please wait.

Order Database – ER Diagram

Similar presentations


Presentation on theme: "Order Database – ER Diagram"— Presentation transcript:

1 Order Database – ER Diagram
Prepared by Greg Ashley Fall 2016

2 Designing Databases with Entity Relationship Diagrams
Step 1: Define Entity Classes and Primary Keys Step 2: Define Relationships Among Entity Classes Step 3: Define Attributes for each Table Step 4: Create Database

3 Step 1: Define Entity Classes and Primary Keys
There is not a limit to the number of orders a customer may place. Each customer can have one order, many orders, or be in your database without any orders. Each order is made by a single customer. Orders must have at least one product. Orders may have multiple products. The same product could be sold through many orders. Products can be listed in the database but not ordered by a customer. Step 1: Define Entity Classes and Primary Keys Entity Class Primary Key Customer CustomerID Orders OrderID Product ProductID OrderItem Business Rules Customer may have many orders. 2. Customers may have no orders. 3. Order can only have one customer. 4. Order must have a customer. 5. Orders must have a product. 6. Orders may have many products. 7. Products may be on many orders. 8. Products may not be on any order.

4 Step 2: Define Relationships Among Entity Classes
CUSTOMER ORDER Product

5 Step 3: Define Attributes for each Table
CUSTOMER CustomerID FirstName LastName Address Major Location Gender ORDER ProductID ProductName Price Type Description BatchSize PRODUCT ProductID OrderID Quantity

6 Step 4: Create Database


Download ppt "Order Database – ER Diagram"

Similar presentations


Ads by Google