1 / 51

IS 325 Notes for Wednesday September 4, 2013

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

Télécharger la présentation

IS 325 Notes for Wednesday September 4, 2013

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IS 325 Notes for Wednesday September 4, 2013

  2. Syllabus Change • I eliminated quizzes • I increased the points allocated to homework assignments

  3. 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

  4. ENTITIES • Entities - constructs that represent what the database keeps track of… something of specific interest • The basic building blocks of an ER diagram • Represent 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

  5. ENTITIES Two entities

  6. ENTITIES • Entity instances (entity members) - occurrences of an entity • Entities themselves are depicted in the ER diagrams while entity instances are not • Entity instances are eventually recorded in the database that is created based on the ER diagram • Each entity instance becomes a row in the database

  7. ATTRIBUTES • Attribute - a characteristic of an entity • Represents the details that will be recorded for each entity instance • Within 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 instance • Every regular entity must have at least one unique attribute or a set of attributes (think George Foreman)

  8. ATTRIBUTES An entity with attributes

  9. RELATIONSHIPS • Relationship – meaningful or naturally occurring associations between entities • Within an ER diagram, each entity must be related to at least one other entity via a relationship

  10. RELATIONSHIPS • Cardinality constraints - depict how many instances of one entity can be associated with instances of another entity • Maximum 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))

  11. RELATIONSHIPS A relationship between two entities

  12. RELATIONSHIPS Four possible cardinality constraints

  13. RELATIONSHIPS Several possible versions of the relationship "ReportsTo"

  14. 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)

  15. RELATIONSHIPS Three types of relationships (maximum cardinality-wise)

  16. RELATIONSHIPS 1:M Relationship M:N Relationship 1:1 Relationship

  17. RELATIONSHIPS • Relationship instances - occurrences of a relationship • Occur 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

  18. RELATIONSHIPS A relationship and its instances

  19. RELATIONSHIPS • Relationship attributes • In some cases M:N relationships can actually have attributes of their own

  20. RELATIONSHIPS A M:N relationship with an attribute

  21. RELATIONSHIPS A 1:M relationship with and without an attribute

  22. ER diagram example: ZAGI Retail Company Sales Department Database

  23. ATTRIBUTES • Composite attribute – attribute that is composed of several attributes (an amalgam or composite) • Not an additional attribute of an entity • Its purpose is to indicate a situation in which a collection of attributes has an additional meaning, besides the individual meanings of each attribute

  24. ATTRIBUTES An entity with a composite attribute

  25. ATTRIBUTES Another entity with a composite attribute

  26. ATTRIBUTES Composite attributes sharing components

  27. ATTRIBUTES • Composite unique attribute – attribute that is composed of several attributes and whose value is different for each entity instance

  28. ATTRIBUTES An entity with a unique composite attribute

  29. 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

  30. ATTRIBUTES An entity with multiple unique attributes (candidate keys)

  31. 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)

  32. ATTRIBUTES • Multivalued attribute - attribute for which instances of an entity can have multiple values for the same attribute

  33. ATTRIBUTES A multivalued attribute

  34. ATTRIBUTES A scenario that does not use multivalued attributes

  35. ATTRIBUTES • Derived attribute - attribute whose values are calculated and not permanently stored in a database

  36. ATTRIBUTES A derived attribute example

  37. ATTRIBUTES Another derived attribute example

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

  39. ATTRIBUTES An optional attribute example

  40. ATTRIBUTES EXAMPLE: An entity with various types of attributes

  41. RELATIONSHIPS • Exact minimum and maximum cardinality in relationships • In some cases the exact minimum and/or maximum cardinality in relationships is known in advance • Exact minimum/and or maximum cardinalities can be depicted in ER diagrams

  42. RELATIONSHIPS A relationship with specific minimum and maximum cardinalities

  43. RELATIONSHIPS

  44. 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)

  45. RELATIONSHIPS Unary relationship examples

  46. 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

  47. RELATIONSHIPS Unary relationships with role names

  48. RELATIONSHIPS A binary relationship with role names

  49. RELATIONSHIPS • Multiple relationships between same entities • Same entities in an ER diagram can be related via more than one relationship

  50. RELATIONSHIPS Multiple relationships between the same entities

More Related