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 ClassPrimary Key CUSTOMERCustomer ID ORDEROrder ID PRODUCTProduct ID ORDERITEMOrderID and ProductID Step 1: Define Entity Classes and Primary Keys Business Rules 1. 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 IDCustomerNamePhoneNumberCustomer CUSTOMER OrderIDCustomerNameOrderDate ORDER OrderIDProductID ORDERITEM ProductIDProductName PRODUCT
Step 3: Define Attributes for each Table CustomerIDFirstNameLastName AddressMajor LocationGender CUSTOMER OrderIDCustomerIDOrderDate ORDER OrderIDProductIDQuantity ORDERITEM ProductIDProductNamePriceBatchSizeDescription Type PRODUCT
List and Describe the Four Characteristics of a Relational Database. 1.Collection of Data 2.Logical Structure 3.Logical Ties (Foreign Key and Primary Key) 4.Integrity Constraints (Rules)
Step 4: Create Database