Order Database – ER Diagram Prepared by Bryce Rogers 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, multiple 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. Entity Class Primary Key CUSTOMER CustomerID ORDER OrderID PRODUCT ProductID ORDERITEM OrderID ProductID Business Rules 1. Customer may have many orders. 2. Customers may have no orders. 3. An order can only have one customer. 4. An order must have a customer. 5. Orders must have at least one product. 6. Orders may consist of multiple products. 7. Product can be prominent through multiple orders. 8. Products listed in the database don’t have to be ordered by a customer.
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 OrderID CustomerID OderDate PRODUCT ProductID ProductName Price BatchSize Description Type ORDERITEM OrderID ProductID Quantity
Step 4: Create Database http://students.uwyo.edu/broger10/IMGT2400/CCCDataBase.accdb