is 325 notes for wednesday september 4, 2013
DESCRIPTION
IS 325 Notes for Wednesday September 4, 2013. Syllabus Change. I eliminated quizzes I increased the points allocated to homework assignments. Entity-Relationship Modeling/Diagrams. Entity-relationship (ER) modeling - conceptual database modeling technique - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/1.jpg)
IS 325
Notes for
Wednesday
September 4, 2013
![Page 2: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/2.jpg)
Syllabus Change
• I eliminated quizzes
• I increased the points allocated to homework assignments
![Page 3: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/3.jpg)
Entity-Relationship Modeling/Diagrams
• Entity-relationship (ER) modeling - conceptual database modeling technique Enables the structuring and organizing of the
requirements collection process Provides a way to graphically represent the
requirements
• ER diagram (ERD) - the result of ER modeling Serves as a blueprint for the database
![Page 4: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/4.jpg)
ENTITIES
• Entities - constructs that represent what the database keeps track of… something of specific interestThe basic building blocks of an ER diagramRepresent various real world notions, such as
people, places, objects, events, items, and other concepts (think “nouns”)
Within an ERD each entity must have a different name and different semantic meaning
![Page 5: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/5.jpg)
ENTITIES
Two entities
![Page 6: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/6.jpg)
ENTITIES
• Entity instances (entity members) - occurrences of an entityEntities themselves are depicted in the ER
diagrams while entity instances are notEntity instances are eventually recorded in the
database that is created based on the ER diagramEach entity instance becomes a row in the
database
![Page 7: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/7.jpg)
ATTRIBUTES
• Attribute - a characteristic of an entityRepresents the details that will be recorded for each
entity instanceWithin one entity, each attribute must have a
different name and different semantic meaning
• Unique Attribute/Set of Attributes – an attribute or set of attributes that have a value(s) is different for each entity instanceEvery regular entity must have at least one unique
attribute or a set of attributes (think George Foreman)
![Page 8: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/8.jpg)
ATTRIBUTES
An entity with attributes
![Page 9: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/9.jpg)
RELATIONSHIPS
• Relationship – meaningful or naturally occurring associations between entitiesWithin an ER diagram, each entity must be related
to at least one other entity via a relationship
![Page 10: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/10.jpg)
RELATIONSHIPS
• Cardinality constraints - depict how many instances of one entity can be associated with instances of another entityMaximum cardinality
One (represented by a straight bar I (Roman Numeral 1))
Many (represented by a crow’s foot symbol)
Minimum cardinality (participation)Zero or Optional (represented by a circular symbol: 0
(Roman Numeral 0))
Mandatory (represented by a straight bar I (roman Numeral 1))
![Page 11: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/11.jpg)
RELATIONSHIPS
A relationship between two entities
![Page 12: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/12.jpg)
RELATIONSHIPS
Four possible cardinality constraints
![Page 13: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/13.jpg)
RELATIONSHIPS
Several possible versions of the relationship "ReportsTo"
![Page 14: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/14.jpg)
RELATIONSHIPS
• Types of Relationships (maximum cardinality-wise)One-to-one relationship (1:1)One-to-many relationship (1:M)Many-to-many relationship (M:N)
![Page 15: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/15.jpg)
RELATIONSHIPS
Three types of relationships (maximum cardinality-wise)
![Page 16: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/16.jpg)
RELATIONSHIPS
1:M Relationship
M:N Relationship
1:1 Relationship
![Page 17: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/17.jpg)
RELATIONSHIPS
• Relationship instances - occurrences of a relationshipOccur when an instance of one entity is naturally
or meaningfully associated to an instance of another entity via a relationship
Relationship themselves are depicted in the ER diagrams while relationship instances are not
Relationship instances are eventually recorded in the database that is created based on the ER diagram
![Page 18: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/18.jpg)
RELATIONSHIPS
A relationship and its instances
![Page 19: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/19.jpg)
RELATIONSHIPS
• Relationship attributes In some cases M:N relationships can actually have
attributes of their own
![Page 20: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/20.jpg)
RELATIONSHIPS
A M:N relationship with an attribute
![Page 21: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/21.jpg)
RELATIONSHIPS
A 1:M relationship with and without an attribute
![Page 22: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/22.jpg)
ER diagram example: ZAGI Retail Company Sales Department Database
![Page 23: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/23.jpg)
ATTRIBUTES
• Composite attribute – attribute that is composed of several attributes (an amalgam or composite)Not an additional attribute of an entityIts purpose is to indicate a situation in which a
collection of attributes has an additional meaning, besides the individual meanings of each attribute
![Page 24: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/24.jpg)
ATTRIBUTES
An entity with a composite attribute
![Page 25: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/25.jpg)
ATTRIBUTES
Another entity with a composite attribute
![Page 26: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/26.jpg)
ATTRIBUTES
Composite attributes sharing components
![Page 27: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/27.jpg)
ATTRIBUTES
• Composite unique attribute – attribute that is composed of several attributes and whose value is different for each entity instance
![Page 28: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/28.jpg)
ATTRIBUTES
An entity with a unique composite attribute
![Page 29: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/29.jpg)
ATTRIBUTES
• Multiple unique single attributes or minimal sets of attributes (candidate keys) - when an entity has more than one unique attribute each unique attribute is also called a candidate key
![Page 30: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/30.jpg)
ATTRIBUTES
An entity with multiple unique attributes (candidate keys)
![Page 31: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/31.jpg)
ATTRIBUTES
An entity with a candidate key and composite key (which does not satisfy the requirements of of a candidate key… I differ with the text authors)
![Page 32: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/32.jpg)
ATTRIBUTES
• Multivalued attribute - attribute for which instances of an entity can have multiple values for the same attribute
![Page 33: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/33.jpg)
ATTRIBUTES
A multivalued attribute
![Page 34: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/34.jpg)
ATTRIBUTES
A scenario that does not use multivalued attributes
![Page 35: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/35.jpg)
ATTRIBUTES
• Derived attribute - attribute whose values are calculated and not permanently stored in a database
![Page 36: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/36.jpg)
ATTRIBUTES
A derived attribute example
![Page 37: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/37.jpg)
ATTRIBUTES
Another derived attribute example
![Page 38: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/38.jpg)
ATTRIBUTES
• Optional attribute - attribute that is allowed to not have a value
![Page 39: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/39.jpg)
ATTRIBUTES
An optional attribute example
![Page 40: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/40.jpg)
ATTRIBUTES
EXAMPLE: An entity with various types of attributes
![Page 41: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/41.jpg)
RELATIONSHIPS
• Exact minimum and maximum cardinality in relationships In some cases the exact minimum and/or maximum
cardinality in relationships is known in advanceExact minimum/and or maximum cardinalities can
be depicted in ER diagrams
![Page 42: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/42.jpg)
RELATIONSHIPS
A relationship with specific minimum and maximum cardinalities
![Page 43: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/43.jpg)
RELATIONSHIPS
![Page 44: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/44.jpg)
RELATIONSHIPS
• Degree of a relationship - reflects how many entities are involved in the relationship
• Binary relationship - relationship between two entities (degree 2 relationship)
• Unary relationship (recursive relationship) - occurs when an entity is involved in a relationship with itself (degree 1 relationship)
![Page 45: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/45.jpg)
RELATIONSHIPS
Unary relationship examples
![Page 46: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/46.jpg)
RELATIONSHIPS
• Relationship roles - additional syntax that can be used in ER diagrams at the discretion of a data modeler to clarify the role of each entity in a relationship
![Page 47: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/47.jpg)
RELATIONSHIPS
Unary relationships with role names
![Page 48: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/48.jpg)
RELATIONSHIPS
A binary relationship with role names
![Page 49: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/49.jpg)
RELATIONSHIPS
• Multiple relationships between same entitiesSame entities in an ER diagram can be related via
more than one relationship
![Page 50: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/50.jpg)
RELATIONSHIPS
Multiple relationships between the same entities
![Page 51: IS 325 Notes for Wednesday September 4, 2013](https://reader030.vdocuments.site/reader030/viewer/2022032805/568132a8550346895d994a15/html5/thumbnails/51.jpg)
Chalk Talk And Examples
• Let’s practice