Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 11 (I) CIS458 Sungchul Hong. Chapter 11 - Objectives How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated.

Similar presentations


Presentation on theme: "Chapter 11 (I) CIS458 Sungchul Hong. Chapter 11 - Objectives How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated."— Presentation transcript:

1 Chapter 11 (I) CIS458 Sungchul Hong

2 Chapter 11 - Objectives How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated with ER model. Diagrammatic technique for displaying ER model using Unified Modelling Language (UML). How to identify and resolve problems with ER models called connection traps. How to build an ER model from a requirements specification.

3 Entity-Relationship Model ER modeling is a top-down approach to database design. Unified Modeling Language

4 ER Diagram of Branch View of DreamHome

5 Concepts of the ER Model Entity types Relationship types Attributes

6 Entity Type Entity type –Group of objects with same properties, identified by enterprise as having an independent existence. Entity occurrence –Uniquely identifiable object of an entity type.

7 Entity Type & Entity Occurrence EmployeeCompany

8 Examples of Entity Types

9 ER Diagram of Staff and Branch Entity Types

10 Entities (EX) A college is divided into several schools. Each school is administered by a dean. A dean is a professor Each school is composed of several departments. Each department offers several courses. A course can have many sections Each professor may teach up to four classes, each one a section of a course. A professor may also be on a research contract and teach no classes at all.

11 Relationship Types Relationship type –Set of meaningful associations among entity types. Relationship occurrence –Uniquely identifiable association, which includes one occurrence from each participating entity type.

12 Semantic Net of Has Relationship Type Branch has staff

13 ER Diagram of Branch Has Staff Relationship

14 Relationship Types Degree of a Relationship –Number of participating entities in relationship. Relationship of degree: –two is binary; –three is ternary; –four is quaternary.

15 Binary Relationship called POwns

16 Ternary Relationship called Registers

17 Question Can three binary relationships substitute a ternary relationship? (In general)

18 Quaternary Relationship called Arranges

19 Relationship Types Recursive Relationship –Relationship type where same entity type participates more than once in different roles. Relationships may be given role names to indicate purpose that each participating entity type plays in a relationship.

20 Recursive Relationship called Supervises with Role Names

21 Entities associated through two distinct Relationships with Role Names

22 Attributes Attribute –Property of an entity or a relationship type. Attribute Domain –Set of allowable values for one or more attributes.

23 Attributes Simple Attribute –Attribute composed of a single component with an independent existence. Composite Attribute –Attribute composed of multiple components, each with an independent existence.

24 Attributes Single-valued Attribute –Attribute that holds a single value for each occurrence of an entity type. Multi-valued Attribute –Attribute that holds multiple values for each occurrence of an entity type.

25 Attributes Derived Attribute –Attribute that represents a value that is derivable from value of a related attribute, or set of attributes, not necessarily in the same entity type.

26 car 1 ((ABC 123, TEXAS), TK629, Ford Mustang, convertible, 1999, (red, black)) car 2 ((ABC 123, NEW YORK), WP9872, Nissan 300ZX, 2-door, 2002, (blue)) car 3 ((VSY 720, TEXAS), TD729, Buick LeSabre, 4-door, 2003, (white, blue)). CAR Registration(RegistrationNumber, State), VehicleID, Make, Model, Year, (Color)

27 Keys Candidate Key –Minimal set of attributes that uniquely identifies each occurrence of an entity type. Primary Key –Candidate key selected to uniquely identify each occurrence of an entity type. Composite Key –A candidate key that consists of two or more attributes.

28 Primary Key (EX) staffNo, name, position salary, totalStaff branchNo, address {street, city, zip code, telephone number[1..3]} Patient number, patient name, drug number, drug name, description, dosage, method of admin, units per day, start date, finish date.

29 ER Diagram of Staff and Branch Entities and their Attributes

30 Entity Type Strong Entity Type –Entity type that is not existence-dependent on some other entity type. Weak Entity Type –Entity type that is existence-dependent on some other entity type.

31 Strong Entity Type called Client and Weak Entity Type called Preference

32 Relationship called Advertises with Attributes NPDC N1P1110 N1P2110 N2P1120


Download ppt "Chapter 11 (I) CIS458 Sungchul Hong. Chapter 11 - Objectives How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated."

Similar presentations


Ads by Google