ksuweb.kennesaw.eduksuweb.kennesaw.edu/~kqian/CS3153 and 5153(summer)/E-R... · Web viewBegin...

12
Creating ER Diagrams with MS Visio 1. Open Microsoft Visio (Start -> Programs -> Microsoft Office -> Microsoft Office Visio 2007) 2. As soon as you start Visio you will either need to identify a new Template Categories. Select a new drawing with the Database category and the Database Model Diagram template. 3. Visio will then give you a blank worksheet and the template containing the basic shapes and connector for the chosen drawing type.

Transcript of ksuweb.kennesaw.eduksuweb.kennesaw.edu/~kqian/CS3153 and 5153(summer)/E-R... · Web viewBegin...

Page 1: ksuweb.kennesaw.eduksuweb.kennesaw.edu/~kqian/CS3153 and 5153(summer)/E-R... · Web viewBegin creating your ER diagram by clicking the Entity shape on the left of the window. Drag

Creating ER Diagrams with MS Visio

1. Open Microsoft Visio(Start -> Programs -> Microsoft Office -> Microsoft Office Visio 2007)

2. As soon as you start Visio you will either need to identify a new Template Categories. Select a new drawing with the Database category and the Database Model Diagram template.

3. Visio will then give you a blank worksheet and the template containing the basic shapes and connector for the chosen drawing type.

Page 2: ksuweb.kennesaw.eduksuweb.kennesaw.edu/~kqian/CS3153 and 5153(summer)/E-R... · Web viewBegin creating your ER diagram by clicking the Entity shape on the left of the window. Drag

4. Begin creating your ER diagram by clicking the Entity shape on the left of the window.

5. Drag the entity shape to your worksheet. You can reposition it at any time. You can delete any shape by clicking it and pressing the delete key.

Page 3: ksuweb.kennesaw.eduksuweb.kennesaw.edu/~kqian/CS3153 and 5153(summer)/E-R... · Web viewBegin creating your ER diagram by clicking the Entity shape on the left of the window. Drag

6. Double click the entity to view and edit its name, columns, primary key, secondary indicates, etc.

7. Change the default name of the entity to tbParent.

Page 4: ksuweb.kennesaw.eduksuweb.kennesaw.edu/~kqian/CS3153 and 5153(summer)/E-R... · Web viewBegin creating your ER diagram by clicking the Entity shape on the left of the window. Drag

8. Switch to the Columns category and enter the names of the five fields in the table; The default data type is char(10), if desired, you can change the columns to their correct data types; Also, indicate the Required and Primary key status for each field.

Page 5: ksuweb.kennesaw.eduksuweb.kennesaw.edu/~kqian/CS3153 and 5153(summer)/E-R... · Web viewBegin creating your ER diagram by clicking the Entity shape on the left of the window. Drag

9. Follow the same basic steps to create a second table. Notice that the tbChild table contains two social security number fields. Mother SSN will be a foreign key to tbParent.

10. Click the Relationship connector in the template, drag and drop the relationship connector to any blank space in your diagram. After that, click the end of the relationship connector with the arrowhead and drag it over tbParent until the border turns red. Then Drag the other end of the relationship connector over tbChild.

Page 6: ksuweb.kennesaw.eduksuweb.kennesaw.edu/~kqian/CS3153 and 5153(summer)/E-R... · Web viewBegin creating your ER diagram by clicking the Entity shape on the left of the window. Drag

11. To correct this foreign key mistake, double click the relationship. Highlight SSN in tbParent and MotherSSN in tbChild, then click the Associate button.

12. Many of the basic drawing style options can be accessed by selecting the Database/Options/Document drop-down menu

Page 7: ksuweb.kennesaw.eduksuweb.kennesaw.edu/~kqian/CS3153 and 5153(summer)/E-R... · Web viewBegin creating your ER diagram by clicking the Entity shape on the left of the window. Drag

13. Select the Crow's Feet option. Notice that the mother-child relationship is shown as mandatory on the one-side and optional on the many-side.

Page 8: ksuweb.kennesaw.eduksuweb.kennesaw.edu/~kqian/CS3153 and 5153(summer)/E-R... · Web viewBegin creating your ER diagram by clicking the Entity shape on the left of the window. Drag

14. Create a new FatherSSN field in tbChild, then create a one-to-many relationship between SSN and FatherSSN.

15. Double click a relationship, then enter a descriptive name. In order to minimize clutter, you might want to use short labels like Mom and Dad.

Page 9: ksuweb.kennesaw.eduksuweb.kennesaw.edu/~kqian/CS3153 and 5153(summer)/E-R... · Web viewBegin creating your ER diagram by clicking the Entity shape on the left of the window. Drag

16. You can change this by double clicking the relationship.

17. If you want to allow a child to not have a father, then de-select the Req'd checkbox for FatherSSN. Now the relationship is optional in both directions.

Page 10: ksuweb.kennesaw.eduksuweb.kennesaw.edu/~kqian/CS3153 and 5153(summer)/E-R... · Web viewBegin creating your ER diagram by clicking the Entity shape on the left of the window. Drag

18. Select the File/Save or File/Save As drop-down menu when you are finished with your diagram.

Page 11: ksuweb.kennesaw.eduksuweb.kennesaw.edu/~kqian/CS3153 and 5153(summer)/E-R... · Web viewBegin creating your ER diagram by clicking the Entity shape on the left of the window. Drag