64 Pages
Unlock Document

Western University
Computer Science
Computer Science 1032A/B
Diane Goldstein

FINAL EXAM NOTES ER DIAGRAMS Database DesignDatabase stores dataDesign reflects the organization that exists within the dataData model Captures organization of the data Logical representationReality and ModelsModel representation of reality that retains only selected detailsPowerful tool for validating necessary details and eliminating irrelevant detailsAssociate or map elements in reality to elements in the model How are Database Applications DevelopedDevelopers interview usersDevelop requirements for new systemAnalyze existing reports forms and user activitiesRequirements summarized in data modelLogical representation of structure of dataContains description of data and relationshipsUsers validate and approve modelDesign implemented in a databaseDatabase filled with user dataReportsRequirementsCreate Data model entities and relationshipsData modelCreate database design tables with foreign keysDatabase designCreate databaseHow to build a databaseFirst make an Entity Relationship Model ER Diagram Visualization diagram of the data Describes the logical database Graphical method of mapping the real worldOnce the ER model is build it is used as a blueprint for the real database ModelsEntityRelationship Model Most popular for data modeling Introduced in 1976 by Peter Chen Many variants Diagrams used Entities attributes Relationships attributes cardinality participation EntityRepresents a discrete object person place thing or eventEx Student course program order customer salesperson AttributesEntities have attributesDescribe properties of the entityEx Student number name birthday InstancesDatabase contains instances of the entitiesAttributes describe the entityAn instance of the entity is a set of data items that existEx 250004524 Rhonda Odanski 543 Richmond St Key AttributesNecessary to uniquely identify the instance of each entityKey attribute vs identifierEx SIN student numbers employee numbers RelationshipsAssociation between two or more entitiesCaptures how the entities are related to one anotherEx PERSON works for COMPANY STUDENT takes COURSERelationships can have attributesEx PERSON works for COMPANY hire date for the person is a detail that describes the relationship CardinalityIndicates the number of instances of the entities that are involved in the relationshipThree categories 11 relationships single entity to single entity 1MM1 relationships one to many single entity to many entities NM relationships many to many 11 RelationshipsRelationship exist faculty member is the chair of a departmentRelationship is a FACULTY MEMBER can be the chair of only one DEPARTMENTEach DEPARTMENT can only have one chair Relationship is 11 1M RelationshipRelationship exists student registered in a FacultyRelationship is STUDENT is only registered in one FACULTYFACULTY can have many STUDENTS registered Therefore this is a 1M relationshipNM RelationshipRelationship exists students taking coursesRelationship is STUDENT can take many courses NCOURSE can be taken by many students MRelationship is NM not the same numbers ParticipationIndicates whether all or only some of the instances of the entity are involved in the relationshipTwo categories Total participation al of the instances are involved in the relationship Partial participation If not all of the instances are involved in the relationship ER SymbolsEntities rectanglesAttributes ovals Key attributes uniquely identifies an entity or relationship Identified by being underlined Relationships diamondsParticipation represented single line represents partial participation double line represents total participationCardinality of a relationship appears on the participation line Designing an ER ModelDiagramStep 1 Collect and review ALL the dataStep 2 Identify entities and attributes draw them on your ER diagram Identify the entities Identify the attributes for each entity Use a rectangle to represent an entity Use an oval to represent an attributeStep 3 Identify the key attributes and underline them on your diagramStep 4 Decide on the relationships and draw lines between the entities including any attributes of the relationshipsUse a diamond to represent a relationship Step 5 Decide on the cardinality of each relationship and add it to the diagramStep 6 Decide on the participation of each entity in each relationship and add if requiredER Diagrams Crows Foot DiagramRectangles represent entitiesRelationships shown by linesCrows foot cardinality Forks at end of lines Indicate more than one relationship manyParticipation Vertical line means at least one entity of that type Small oval means entity is optional Database DesignProcess of converting data model Transforms entities into tables Expresses relationships Shows data constraintsRelational Database DesignDesigner creates table for every entityKey Attribute is primary key of tableAttributes of entity become columnsAttributes of entity become columns Tables normalized to single theme
More Less

Related notes for Computer Science 1032A/B

Log In


Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.