is 325 notes for wednesday september 4, 2013. syllabus change i eliminated quizzes i increased the...

51
IS 325 Notes for Wednesday September 4, 2013

Upload: brenda-parsons

Post on 29-Dec-2015

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

IS 325

Notes for

Wednesday

September 4, 2013

Page 2: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

Syllabus Change

• I eliminated quizzes

• I increased the points allocated to homework assignments

Page 3: 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 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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ENTITIES

Two entities

Page 6: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ATTRIBUTES

An entity with attributes

Page 9: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

RELATIONSHIPS

A relationship between two entities

Page 12: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

RELATIONSHIPS

Four possible cardinality constraints

Page 13: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

RELATIONSHIPS

Several possible versions of the relationship "ReportsTo"

Page 14: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

RELATIONSHIPS

Three types of relationships (maximum cardinality-wise)

Page 16: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

RELATIONSHIPS

1:M Relationship

M:N Relationship

1:1 Relationship

Page 17: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

RELATIONSHIPS

A relationship and its instances

Page 19: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

RELATIONSHIPS

A M:N relationship with an attribute

Page 21: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

RELATIONSHIPS

A 1:M relationship with and without an attribute

Page 22: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ER diagram example: ZAGI Retail Company Sales Department Database

Page 23: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ATTRIBUTES

An entity with a composite attribute

Page 25: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ATTRIBUTES

Another entity with a composite attribute

Page 26: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ATTRIBUTES

Composite attributes sharing components

Page 27: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ATTRIBUTES

An entity with a unique composite attribute

Page 29: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ATTRIBUTES

An entity with multiple unique attributes (candidate keys)

Page 31: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ATTRIBUTES

A multivalued attribute

Page 34: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ATTRIBUTES

A scenario that does not use multivalued attributes

Page 35: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ATTRIBUTES

A derived attribute example

Page 37: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ATTRIBUTES

Another derived attribute example

Page 38: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ATTRIBUTES

• Optional attribute - attribute that is allowed to not have a value

Page 39: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ATTRIBUTES

An optional attribute example

Page 40: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

ATTRIBUTES

EXAMPLE: An entity with various types of attributes

Page 41: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

RELATIONSHIPS

A relationship with specific minimum and maximum cardinalities

Page 43: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

RELATIONSHIPS

Page 44: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

RELATIONSHIPS

Unary relationship examples

Page 46: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

RELATIONSHIPS

Unary relationships with role names

Page 48: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

RELATIONSHIPS

A binary relationship with role names

Page 49: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

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. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

RELATIONSHIPS

Multiple relationships between the same entities

Page 51: IS 325 Notes for Wednesday September 4, 2013. Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments

Chalk Talk And Examples

• Let’s practice