Order Database – ER Diagram Prepared by Greg Ashley Fall 2016
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 There is not a limit to the number of orders a customer may place. Each customer can have one order, many orders, or be in your database without any orders. Each order is made by a single customer. Orders must have at least one product. Orders may have multiple products. The same product could be sold through many orders. Products can be listed in the database but not ordered by a customer. Step 1: Define Entity Classes and Primary Keys Entity Class Primary Key Customer CustomerID Orders OrderID Product ProductID OrderItem Business Rules Customer may have many orders. 2. Customers may have no orders. 3. Order can only have one customer. 4. Order must have a customer. 5. Orders must have a product. 6. Orders may have many products. 7. Products may be on many orders. 8. Products may not be on any order.
Step 2: Define Relationships Among Entity Classes CUSTOMER ORDER Product
Step 3: Define Attributes for each Table CUSTOMER CustomerID FirstName LastName emailAddress Major Location Gender ORDER ProductID ProductName Price Type Description BatchSize PRODUCT ProductID OrderID Quantity
Step 4: Create Database http://students.uwyo.edu/gashley/IMGT2400/CCCDataBase.accdb