Prepared by Trevor Scherlin Fall 2012 DIRTBIKE ORDER DATABASE– ER DIAGRAM.

7
Prepared by Trevor Scherlin Fall 2012 DIRTBIKE ORDER DATABASE– ER DIAGRAM

Transcript of Prepared by Trevor Scherlin Fall 2012 DIRTBIKE ORDER DATABASE– ER DIAGRAM.

Page 1: Prepared by Trevor Scherlin Fall 2012 DIRTBIKE ORDER DATABASE– ER DIAGRAM.

Prepared by

Trevor Scherlin

Fall 2012

DIRTBIKE ORDER DATABASE– ER DIAGRAM

Page 2: Prepared by Trevor Scherlin Fall 2012 DIRTBIKE ORDER DATABASE– ER DIAGRAM.

Step 1: Define Entity Classes and Primary Keys

Step 2: Define Relationships Among Entity Classes

Step 3: Define Fields for each Relationship

Step 4: Create Database

Designing Databases with Entity Relationship Diagrams

Page 3: Prepared by Trevor Scherlin Fall 2012 DIRTBIKE ORDER DATABASE– ER DIAGRAM.

Entity Class Primary Key

Customer CustomerID

Order OrderID

Product ProductID

Distributor DistID

Step 1: Define Entity Classes and Primary Keys

Business RulesEach order is made by a single customer

Each customer can have multiple orders

Each customer can have one order

Customers can be in your database without any orders

Products can be listed in your database but not purchased

Orders cannot be blank

Orders can have more than one (multiple) products

A distributor can supply multiple products

A distributor has to supply at least one product

Each product has to have a distributor

Page 4: Prepared by Trevor Scherlin Fall 2012 DIRTBIKE ORDER DATABASE– ER DIAGRAM.

E-R DIAGRAMSUse 5 symbols

1. Rectangle – entity class

2. Dotted line – relationship

3. | - single relationship

4. 0 – zero/optional relationship

5. Crow’s foot () – multiple relationship

Page 5: Prepared by Trevor Scherlin Fall 2012 DIRTBIKE ORDER DATABASE– ER DIAGRAM.

PRODUCT

CUSTOMER ORDER

Step 2: Define Relationships Among Entity Classes

DISTRIBUTOR

DETAILED ORDERS

Page 6: Prepared by Trevor Scherlin Fall 2012 DIRTBIKE ORDER DATABASE– ER DIAGRAM.

Step 3: Define Fields for each Relationship

CustomerID LastName FirstName Address City State Zipcode PhoneCustomer

OrderID CustomerID OrderDateOrder

ProductID ProductName Maunfacturer Color MSRP Ignition Weight QOH DistIDProduct

DistID DistributorDistributor

OrderID ProductID QuantityDetailed Orders

Page 7: Prepared by Trevor Scherlin Fall 2012 DIRTBIKE ORDER DATABASE– ER DIAGRAM.

Step 4: Create Database

(At this point we will begin working with our DBMS system, which will be Microsoft Access)