Presentation is loading. Please wait.

Presentation is loading. Please wait.

3.1 CSIS 3310 Chapter 3 The Entity-Relationship Model Conceptual Data Modeling.

Similar presentations


Presentation on theme: "3.1 CSIS 3310 Chapter 3 The Entity-Relationship Model Conceptual Data Modeling."— Presentation transcript:

1 3.1 CSIS 3310 Chapter 3 The Entity-Relationship Model Conceptual Data Modeling

2 3.2 CSIS 3310 SDLC Revisited – Data Modeling is an Analysis Activity Project Identification and Selection Project Initiation and Planning Analysis Physical Design Implementation Maintenance Logical Design Purpose –thorough analysis Deliverable – functional system specifications Database activity – conceptual data modeling communication between DB designer & user

3 3.3 CSIS 3310 Business Rules Statements that define or constrain some aspect of the business Assert business structure Control/influence business behavior Expressed in terms familiar to end users Automated through DBMS software

4 3.4 CSIS 3310 A Good Business Rule is: Declarative – what, not how Precise – clear, agreed-upon meaning Atomic – one statement Consistent – internally and externally Expressible – structured, natural language Distinct – non-redundant Business-oriented – understood by business people

5 3.5 CSIS 3310 Sample E-R Diagram

6 3.6 CSIS 3310 E-R Model Constructs Entity –Person: customer, vendor, supplier –Place: location, city, region, territory –Object: vehicle, monitor, part –Event: order, registration, renewal –Concept: expense, flight, project Entity Type versus Entity Instance Entity Type versus System Input, Output, or User

7 3.7 CSIS 3310 Entity symbols Relationship symbols Attribute symbols A special entity that is also a relationship Basic E-R Notation

8 3.8 CSIS 3310 What Should an Entity Be? SHOULD BE: –An object that will have many instances in the database –An object that will be composed of multiple attributes –An object that we are trying to model SHOULD NOT BE: –A user of the database system –An output of the database system (e.g. a report)

9 3.9 CSIS 3310 System user System output Appropriate entities Inappropriate entities

10 3.10 CSIS 3310 Attributes Attribute - property or characteristic of an entity type Classifications of attributes: –Simple versus Composite Attribute –Single-Valued versus Multivalued Attribute –Derived Attributes –Identifier Attributes

11 3.11 CSIS 3310 A composite attribute

12 3.12 CSIS 3310 Entity with a multivalued attribute (Skill) and derived attribute (Years_Employed) Multivalued: an employee can have more than one skill Derived from date employed and current date

13 3.13 CSIS 3310 E-R Model Constructs Identifier or Key –An attribute (or combination of attributes) that uniquely identifies individual instances of an entity type. Simple Key versus Composite Key Candidate Key –an attribute that could be a key…satisfies the requirements for being a key

14 3.14 CSIS 3310 Simple key attribute The key is underlined

15 3.15 CSIS 3310 Composite key attribute The key is composed of two subparts

16 3.16 CSIS 3310 Criteria for Selecting Identifiers (Keys) Will not change in value. Will not be null. No intelligent identifiers –e.g. containing locations or people that might change Substitute new, simple keys for long, composite keys.

17 3.17 CSIS 3310 Strong vs. Weak Entities, and Identifying Relationships Strong entities –exist independently of other types of entities –has its own unique identifier –represented with single-line rectangle Weak entity –dependent on a strong entity…cannot exist on its own –Does not have a unique identifier –represented with double-line rectangle Identifying relationship –links strong entities to weak entities –represented with double line diamond

18 3.18 CSIS 3310 Example of a weak entity

19 3.19 CSIS 3310 Basic E-R Notation

20 3.20 CSIS 3310 Relationships Relationship Types vs. Relationship Instances –The relationship type is modeled as the diamond and lines between entity types Relationships can have attributes –These describe features pertaining to the association between the entities in the relationship Two entities can have more than one type of relationship between them (multiple relationships)

21 3.21 CSIS 3310 Relationship type (Completes)

22 3.22 CSIS 3310 Relationship instances

23 3.23 CSIS 3310 Attribute on a relationship

24 3.24 CSIS 3310 Associative Entity Its an Entity – It’s a Relationship When should a relationship be an Associative Entity? –All relationships involved are “many” –Associative entity has independent meaning –Has one or more non-key attributes –Independent relationships

25 3.25 CSIS 3310 An associative entity (CERTIFICATE)

26 3.26 CSIS 3310 Degree of Relationships Degree of a Relationship - number of entity types that participate in it. –Unary (or Recursive) Relationship –Binary –Ternary

27 3.27 CSIS 3310 One entity related to another of the same entity type Entities of two different types related to each other Entities of three different types related to each other Degree of relationships

28 3.28 CSIS 3310 Binary relationships

29 3.29 CSIS 3310 Unary relationships

30 3.30 CSIS 3310 Represents a bill-of -materials structure This has a many-to-many relationship A unary relationship with an attribute

31 3.31 CSIS 3310 An Associative Entity Bill of Materials Structure

32 3.32 CSIS 3310 Ternary relationships

33 3.33 CSIS 3310 A ternary relationship as an associative entity

34 3.34 CSIS 3310 Multivalued attribute vs. relationship. Alternative approaches

35 3.35 CSIS 3310 Cardinality of Relationships One – to – One –Each entity in the relationship will have exactly one related entity One – to – Many –An entity on one side of the relationship can have many related entities, but an entity on the other side will have a maximum of one related entity Many – to – Many –Entities on both sides of the relationship can have many related entities on the other side

36 3.36 CSIS 3310 Cardinality Constraints The number of instances of one entity that can or must be associated with each instance of another entity –Minimum Cardinality If zero, then optionalIf zero, then optional If one or more, then mandatoryIf one or more, then mandatory –Maximum Cardinality –Mandatory One - when min & max both = 1

37 3.37 CSIS 3310 Cardinality notation

38 3.38 CSIS 3310 Mandatory cardinalities Cardinality constraints

39 3.39 CSIS 3310 One optional, one mandatory cardinality Cardinality constraints

40 3.40 CSIS 3310 Optional cardinalities with unary degree, one-to-one relationship

41 3.41 CSIS 3310 Cardinality constraints in a ternary relationship

42 3.42 CSIS 3310 Modeling Time-Dependent Data Time Stamps

43 3.43 CSIS 3310 Multiple Relationships More than one relationship between the same entity types

44 3.44 CSIS 3310 Multiple relationship with fixed cardinality constraint

45 3.45 CSIS 3310 E-R Diagram for Pine Valley

46 3.46 CSIS 3310 Pine Valley Furniture User View 1: Orders for customers

47 3.47 CSIS 3310 Pine Valley Furniture User View 2: Orders for products

48 3.48 CSIS 3310 Synonyms you should know… Entity = relation = table Attribute = column Instance = row rows columns table


Download ppt "3.1 CSIS 3310 Chapter 3 The Entity-Relationship Model Conceptual Data Modeling."

Similar presentations


Ads by Google