CIS_223_1.7_Guided Practice_ Cardinality

docx

School

ECPI University, Manassas *

*We aren’t endorsed by this school

Course

223

Subject

Computer Science

Date

Jan 9, 2024

Type

docx

Pages

4

Uploaded by DukeStrawGorilla22

Report
The purpose of this exercise is to create an ER diagram applying specific cardinality using crow’s feet notation in MS Visio. Open MS Visio Select Crow’s Feet Database Notation 1. Drag two entity items onto the grid and name them PROFESSOR and CLASS. 2. Now we will add primary keys and attributes for both tables. Remember that a primary key field should contain a unique value – this means that every record in the table will contains its own unique field value. 3. Next, we will set the 1:M relationship between the two tables. First, we need to add the primary key of the parent (1 side) table into the child (many side) table as a foreign key attribute. In this case we will add the PROF_ID into the CLASS table as a foreign key. Don’t forget to add the FK icon by selecting the attribute box, right clicking, and selecting the ‘set foreign key’ option. Once you add the foreign key drag the relationship line onto the grid.
4. Now, you will connect the 1 side of the relation line to the PROF_ID attribute in the PROFESSOR table and the many crow’s feet notation to the PROF_ID foreign key attribute in the CLASS table. If by chance you need to change the crow’s feet symbols on either end of the relation line. Click on the line and select set end or beginning symbols. Change the crow’s feet connecting to the PROF_ID (FK) foreign key to show “1 or more – it is mandatory to have at least one, but you can have many”
Zero or more – it is optional to have but you can have many 1 or more – it is mandatory to have at least one, but you can have many 1 and only 1 – it is mandatory that you have at least one Zero or 1 – it is optional to have, but you can have 1 5. To set the cardinality, you must review the business rules carefully. You want to see if certain nouns are optional or mandatory. You also should go back and review the symbols before changing the beginning and end symbols on the relation line. Here are the business rules that coincide with the diagram above. A professor teaches many classes. A professor must teach a minimum of 1 class and a maximum of 4 classes. A class must be taught by one professor. As you can see there are mandatory constraints on both sides of the relationship. The optional symbols contain the circle and the mandatory the straight line. There are specific minimum and maximum cardinalities as well (1,4). Because we cannot accurately depict this in the ER diagram we use the text box and write them in at the ends of the relation line. See image below. You insert the textboxes by selecting the rectangle box under the Tools option. 6. Upload your .vsdx file containing the ER diagram as seen in step #5 for grading.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help