S5 elementary erd pdf
Upcoming SlideShare
Loading in...5
×
 

S5 elementary erd pdf

on

  • 524 views

 

Statistics

Views

Total Views
524
Views on SlideShare
524
Embed Views
0

Actions

Likes
0
Downloads
11
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    S5 elementary erd pdf S5 elementary erd pdf Document Transcript

    • Copyright © 2009 Bahn, D., Yardley, A. & Tang, H. All Rights Reserved. ISBN: 978-1-936203-09-3 Systems Analysis and Design Learning Module Series #5 Document version Creating an Elementary Entity Relationship DiagramOverviewIn this tutorial we will create an Entity Relationship Diagram (ERD) that contains two entities andwe will customize these entities into a One-to-Many relationship. We will: • Initialize a new diagram • Create an Entity Relationship Diagram (ERD) that contains two entities • Customize the fields/columns of these entities and assign primary keys • Adjust the diagram symbols (such as the crows foot symbol) • Link the entities together, and • Decipher the symbols, the semantics of the created ERDInitializing a new diagram in MS Visio 2007   1. From the Menu Bar, click File… New… Software and Database… Database Model Diagram (US units) from the cascading drop down menus. 1
    • Copyright © 2009 Bahn, D., Yardley, A. & Tang, H. All Rights Reserved. ISBN: 978-1-936203-09-3Creating two related entities   From the Shapes pane, drag the Entity shape over to the workspace grid.2. Under Database Properties, click Definition and type: Course in the “Physical name” text box field.Customize fields and assign Primary Keys3. Under Database Properties, under Categories, click on Columns and under the “Physical Name column”, enter the following attributes: course_ID, course_title, credits, and grading_method. 2
    • Copyright © 2009 Bahn, D., Yardley, A. & Tang, H. All Rights Reserved. ISBN: 978-1-936203-09-34. Locate the row for attribute course_ID and check the box under “PK” to designate this attribute as the Primary key. (Notice how the entity Course places the “PK course_ID” above the line.)5. Repeat steps 3 through 5 for the second entity: Course_Sections. Its column names should be: section_ID, course_ID, location, employee_ID, and day_of_week. Additionally, section_ID should be designated as the Primary Key. 3
    • Copyright © 2009 Bahn, D., Yardley, A. & Tang, H. All Rights Reserved. ISBN: 978-1-936203-09-3Adjusting the diagram symbols    Before we create a relationship between these 2 tables, we will need to set the display format options for the connector symbols.6. From the Menu Bar, click on Database and select Options… Document from the cascading drop down menu.7. The Database Document Options dialog box displays. Under the Relationship tab, check both the Relationships and Crow’s feet check boxes. Click OK. 4
    • Copyright © 2009 Bahn, D., Yardley, A. & Tang, H. All Rights Reserved. ISBN: 978-1-936203-09-3Creating the relationship   8. From the Shapes pane, drag the Relationship shape and drop it on top of the Course entity. The Course entity will appear in Visio with a red box as shown below.9. The reason we dropped the Relationship shape onto the Course entity, is because the Course entity is the Parent entity in the relationship. Since courses and sections share a One-to-Many relationship, we can view their relationship as Parent-Child. A course (parent) can have many sections (child-ren) associated with it, but a section can only exist if there is a course to which it is associated.Linking the entities together  10. Drag the unattached end of the relationship shape (green box end) over to the Course_Section entity. 5
    • Copyright © 2009 Bahn, D., Yardley, A. & Tang, H. All Rights Reserved. ISBN: 978-1-936203-09-311. After the relationship shape is dropped it will display the red end-boxes (indicated by the blue arrow below. Click anywhere on the grid to have it appear as shown by the red arrow.Deciphering the Symbols    Notice the symbols at each end of the relationship join. There are four symbols on a dotted line. The One-to-Many relationship between Course and Course_Section is represented by a “1” designated to the end of the dotted line that connects to the Course (Parent) entity – see item 1 below; and a “crows foot” symbol designated to the end of the dotted line that connects to the Course_Section (Child) entity – see item 4 below. These two symbols reflect the maximum cardinality of the relationship. The “O” symbol shown below in items 2 and 3, are the defaults that Visio supplies. These reflect the minimum cardinality of the relationship, the “O” representing an Optional relationship. Since we know that a course may or not have a section associated with it, the default “Optional” minimum cardinality remains true for the Course entity. Therefore ‘reading’ the symbolism from the perspective of Course: (Left to Right) A course may have as few as zero sections associated with it (item 3 below), or as many as numerous (item 4 below). 6
    • Copyright © 2009 Bahn, D., Yardley, A. & Tang, H. All Rights Reserved. ISBN: 978-1-936203-09-3 We know that any given section can belong only to one course. Therefore ‘reading’ the symbolism from the perspective of Course_Section: (Right to Left), sections have a maximum cardinality of one (item 1 above). However, we also know that a course section cannot exist without an associated course. To put this differently, if a section of a course exists, then that course must exist. So for any course section, at least one instance of the course must exist, even if a maximum of one course exists for that section. In this case then, the default symbol supplied by Visio (item 2 above) is inaccurate and must be changed from an optional “O”, to a mandatory “1”. In this next step then, we will make this change.12. Click on the Relationship shape to highlight it. Under Database Properties… Categories, click on the Miscellaneous category and select the Identifying radio button under “Relationship Type”. Notice how the Parent-to-child relationship now reflects “1-0 or more” and the symbol (circled below in purple) has changed from optional, to accurately reflect a minimum cardinality of mandatory “1”.13. In many schools, course-sections are cross-listed to two or more courses listed in different departments. We will need therefore an additional adjustment. 7
    • Copyright © 2009 Bahn, D., Yardley, A. & Tang, H. All Rights Reserved. ISBN: 978-1-936203-09-3 Click on the Course_Section entity to highlight it. Under Database Properties… Categories, click on the Columns category to display the entity attributes. Locate the row that has the “Physical Name”: course_ID and uncheck the PK check box. Notice how course_ID now becomes a Foreign Key (FK).14. If we think about it though, a course cannot really exist without it ever being offered! Therefore, even if it should have many sections associated to it, at least one of those sections must be offered. The minimum cardinality of a course to a course_section then, is really “1”. Click on the Relationship shape to highlight it. Under Database Properties… Categories, click on the Miscellaneous category and select the One or more radio button under “Cardinality”. Notice the “O” symbol has now changed to a “1”, indicating the mandatory minimum. 8
    • Copyright © 2009 Bahn, D., Yardley, A. & Tang, H. All Rights Reserved. ISBN: 978-1-936203-09-3 This Completes Systems Analysis and Design Learning Module Series #5 Document versionCreating an Elementary Entity Relationship Diagram 9