Explore BrainMass

Entity Relationships in Visio

1) Read the following business requirements closely to determine the entities and relationships needed to fulfill the requirements. The nouns in the paragraph will tell you the entities that will be needed. The verbs in the paragraph will help you determine the relationships between the entities.

Muscles Health Club Database Requirements:
The Muscles Health Club needs a database to keep track of its members, their personal trainers, and the fitness classes they are taking.
Employees can act as personal trainers for members. However, only certified employees can act as personal trainers. A member can work with only one personal trainer at a time.
Members can take multiple fitness classes. Fitness classes are taught by employees who can teach multiple classes. Fitness classes are taught in one of the classrooms at one of Muscles Health Club's several locations.
Each fitness classroom is designed for a different type of class (e.g., spinning, aerobics, water aerobics, weight training, etc.). It is necessary to track what fitness classes are being held in each of the different Muscles Health Club locations.

2) Run Visio 2010 either via Citrix or on your workstation.
- Click on the Software and Database Template group in the main window.
- Double-click on the Database Model Diagram Template to open a new file.
- Save the file with a name containing Lab2_JGreen. You will need to click the computer icon in the Save As window to see the different drives. Be sure to save the file to a local drive so it will be on your workstation.

3) Add an entity for each entity you identified in the requirements.
- Drag the entity icon onto the drawing area in Visio.
- In the Database Properties window, add a physical name to identify it.

4) For each entity, create a list of attributes you think would be useful to describe the entity.
- Select an entity in the drawing area of Visio.
- In the Database Properties window, select the Columns category.
- Use the table to add your attributes to the selected entities.
- Select one of the attributes to be the primary key (PK).

5) Set the diagram to use crow's feet notation.
- On the Database tab, in the Manage group, click Display Options.
- In the Database Document Option dialog, select the Relationship tab.
- Select the Crow's Feet check box, and then click OK.

6) Draw relationships between your entities.
- Drag the relationship icon onto a blank part of the drawing area.
- Connect the two ends to each of the two entities in the relationship. The parent entity must have a PK defined. The entity will be outlined in bold red lines when it connects to one end of the relationship.

7) Set the cardinality of your relationships.
- Select a relationship line in the drawing area that is connecting two entities.
- In the Database Properties window, select the Miscellaneous category.
- Select the cardinality for the selected relationship.

Solution Summary

The solution contain the Entity Relationship/ Data model diagram in VISIO for the stated problem. It also provides a complete scripts for the database queries for the same problem. These are the sql queries to create the tables and the relationship between them as per the ER-diagram model.