7
DirtBike Order Database– ER Diagram Prepared by Shaylee Thar Fall 2012

DirtBike Order Database– ER Diagram Prepared by Shaylee Thar Fall 2012

Embed Size (px)

Citation preview

Page 1: DirtBike Order Database– ER Diagram Prepared by Shaylee Thar Fall 2012

DirtBike Order Database– ER Diagram

Prepared by

Shaylee Thar

Fall 2012

Page 2: DirtBike Order Database– ER Diagram Prepared by Shaylee Thar Fall 2012

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: DirtBike Order Database– ER Diagram Prepared by Shaylee Thar Fall 2012

Entity Class Primary Key

Customer Customer ID

Order Order ID

Product Product ID

Distributor Dist ID

Step 1: Define Entity Classes and Primary Keys

Business RulesEach customer can have one order

Each customer can have multiple orders

Customers can be in your database and not have any orders

Each order is made by a single customer

Orders may have multiple products

Each product has to have a distributor

Orders cannot be blank but have at least one product

Products can be listed in your database but not purchased

The same product can be purchased through many orders

A distributor can supply multiple products

A distributor has to supply at least one product

Page 4: DirtBike Order Database– ER Diagram Prepared by Shaylee Thar Fall 2012

E-R Diagrams

Use 5 symbols1. Rectangle – entity class

2. Dotted line – relationship

3. | - single relationship

4. 0 – zero/optional relationship

5. Crow’s foot () – multiple relationship

Page 5: DirtBike Order Database– ER Diagram Prepared by Shaylee Thar Fall 2012

PRODUCT

CUSTOMER ORDER

Step 2: Define Relationships Among Entity Classes

DISTRIBUTOR

Detailed Orders

Page 6: DirtBike Order Database– ER Diagram Prepared by Shaylee Thar Fall 2012

Step 3: Define Fields for each Relationship

Customer ID LastName FirstName Address City State Zip Phone

Customer

Order ID Customer ID

Order

Product ID Product Name Manufacturer Color MSRP Ignition Weight QOH Dist ID

Product

Dist ID Distributor

Distributor

Order ID Product ID Quantity

Detailed Orders

Page 7: DirtBike Order Database– ER Diagram Prepared by Shaylee Thar Fall 2012

Step 4: Create Database

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