Upload
phoebe-parker
View
212
Download
0
Embed Size (px)
Citation preview
Order Database – ER Diagram
Prepared by
Megan Foster
Fall Semester 2014
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
Designing Databases with Entity Relationship Diagrams
Entity Class Primary Key
CUSTOMER Customer ID
ORDER Order ID
PRODUCT Product ID
ORDERITEM OrderID and ProductID
Step 1: Define Entity Classes and Primary Keys
Business Rules1. A customer can have unlimited orders.
2. A customer can have one order or have no order.
3. An order can only have one customer.
4. An order must have a product.
5. Orders must have one product
6. Many orders can have the same product.
7. A product can have multiple orders.
8. A product my have no orders.
Step 2: Define Relationships Among Entity Classes
CUSTOMER
PRODUCT
ORDER
ORDERITEM
Step 3: Define Attributes for each Table
Customer ID CustomerName PhoneNumber CustomerEmailCUSTOMER
OrderID CustomerName OrderDate
ORDER
OrderID ProductIDORDERITEM
ProductID ProductNamePRODUCT
Step 3: Define Attributes for each Table
CustomerID FirstName LastName EmailAddress Major
Location Gender
CUSTOMER
OrderID CustomerID OrderDate
ORDER
OrderID ProductID Quantity
ORDERITEM
ProductID ProductName Price BatchSize Description
Type
PRODUCT
List and Describe the Four Characteristics of a Relational Database.
1. Collection of Data2. Logical Structure3. Logical Ties (Foreign Key and Primary
Key)4. Integrity Constraints (Rules)
Step 4: Create Database
http://students.uwyo.edu/Mfoste21/IMGT2400/CowboyCookies.accdb