ER Template - University of Wyoming

Download Report

Transcript ER Template - University of Wyoming

Order Database – ER Diagram
Prepared by
(Nicole Murphy)
Fall 2014
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
Step 1: Define Entity Classes and Primary Keys
Entity Class
Primary Key
CUSTOMER
CustomerID
PRODUCT
OrderID
ORDER
ProductID
ORDERITEM
OrderID and ProductID
Business Rules
1. Customer may have multiple orders.
2. Customer may have no orders.
3. Each order has one Customer.
4. Each order must have a Customer.
5. Orders must have one product.
6. Orders may have multiple products.
7. A product can have multiple orders.
8. A product may have no orders.
Step 2: Define Relationships Among Entity Classes
CUSTOMER
ORDER
ORDERITEM
PRODUCT
Step 3: Define Attributes for each Table
CUSTOMER
CustomerID
CustomerName
PhoneNumber
Customermail
Major
ORDER
OrderID
CustomerName
OrderDate
ProductID
Quantity
ProductName
Price
ORDERITEM
OrderID
PRODUCT
ProductID
Type
BatchSize
Description
Database Review Question
List and describe the four key characteristics of a
relational database.
1. Collection of Information
2. Contain logical structures
3. Logical ties among info.
4. Integrity contraints
Step 4: Create Database
http://students.uwyo.edu/nmurphy4/IMGT2400/CowboyCookies.accdb