260 likes | 369 Views
Visio Starter Tutorial. Developed from Material by Daniel L. Silver http://plato.acadiau.ca/courses/comp/dsilver/3513/Workshops/Data_Model_Tutorial.htm. Outline. Getting Started Entities Relationships Fine-tuning the drawing. Obtain and Install. Sinclair bookstore
E N D
Visio Starter Tutorial Developed from Material by Daniel L. Silver http://plato.acadiau.ca/courses/comp/dsilver/3513/Workshops/Data_Model_Tutorial.htm
Outline • Getting Started • Entities • Relationships • Fine-tuning the drawing
Obtain and Install • Sinclair bookstore • Use standard install process • Tutorial assumes default installation settings • Our classroom already has Visio installed
Opening Screen • Can choose various categories and templates • We will focus on entity relationships • Select Database from Category Menu • Then select Database Model Diagram from Template menu
Resulting Screen Opens new blank worksheet with basic shapes used in creating Entity Relationship Diagrams available for selection
Making Things Easier • Change worksheet view from portrait, to landscape • Do this by clicking File --> Page Setup • Then select landscape
Entities • Entities represent tables in a database • Independent entities do not rely on each other for identification • Dependent entities do rely on each other for identification
Creating Entities in Visio • Click on Entity in the green Entity Relationship menu • Drag the shape onto your worksheet
Refining Raw Entities • Define your Entity's attributes • name, columns, primary keys, … • Click on the new Entity shape to open the database properties windows
Continue to Refine • Switch to the Columns field of the Category menu • Used to enter any attributes that an entity may have. • Allows you to specify the primary key • uniquely identifies entity • Can also specify those columns which are required fields of the entity • order in which you enter fields does not matter • data type changed by clicking on the field and selecting a type from the menu
Changing Fonts • Can change font size by selecting the entity then picking a size from the drop-down menu. • can also change other font attributes • family, color, alignment, ... • Notice that required fields are shown in boldface • all others are shown in standard face
Creating Relationships • Relation lines are used to show the relationship between data in two tables (Entities) • Click the Relationship connector in the Entity Relationship menu • Drag and Drop the shape to any blank space on your current worksheet • best to put it near or between the Entities it will associate
Refining Relationships • Must identify which entity is the Parent Table and which is the Child Table • Child Entity is easily identified as the entity which depends on information from another entity to describe itself • Parent Entity supplies this information to the Child through their relationship • Click the end of the Relationship Connector with the arrowhead • Drag arrowhead over to the border of the Parent Table until the border turns red
The Child Side • Drag the other end of the arrow to the border of the Child Entity until that border turns red
Associating Attributes • Must specify which attribute in Child Entity matches which attribute from Parent Entity • Double click on the Relationship • Opens new menu at bottom of screen • Highlight value in Parent Entity and value in Child Entity to be mapped
Relationship Misc • Notice in the Child Entity, that next to the attribute which is mapped to a value in the Parent Entity appears an FK for Foreign Key • shows that a particular value from the Child Entity is reliant on the Primary Key of the Parent Entity • Click on Miscellaneous in the Categories menu to specify cardinality of the relationship with regard to the Parent Entity • Can reorganize diagram without harm to relationships • move an Entity to a desired position and Visio will move the relationship(s) along with it
Drawing Style Options • Many basic drawing style options can be accessed by selecting Database/Options/Document
Relation Symbols • General tab lets you select symbology • IDEF1X or Relational • also lets you select which set of entity names to display
Items to Display • Table tab lets you select the items to display • PK, FK, secondary indices, non-key fields, data types • Can also display primary key fields at the top of each entity or in their actual physical order • Select Physical Order option in order to have the two SSN fields displayed in their original positions instead of at the top of tblParent and tblChild above the horizontal lines.
Displaying Relationships • Relationship tab lets you display relationships as arrows or as crow's feet • Select Crow's Feet option • Notice that mother-child relationships are shown as mandatory on the one-side and optional on the many-side