Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter Two Database Design (ER Model) Objectives: ER model Type of relationships Role in a relation Concept of Weak entities.

Similar presentations


Presentation on theme: "Chapter Two Database Design (ER Model) Objectives: ER model Type of relationships Role in a relation Concept of Weak entities."— Presentation transcript:

1 Chapter Two Database Design (ER Model) Objectives: ER model Type of relationships Role in a relation Concept of Weak entities

2 2 Entity-Relationship Model (ER-Model) Purpose of ER Model is to allow the description of the conceptual scheme of an enterprise to be written without the attention to efficiency or physical design that is expected by most other models.

3 3 Entity-Relationship Model (ER-Model) A set of basic objects called Entity, and a set of Relationships among objects (Entities) Many-to-Many relationship Best Data Model ??

4 4 Entity and Entity Set: Entity: An object that exists and is distinguishable from other objects Car ? VW? Entity Set: A set of entities of the same type Entity set need not be disjoint (Faculty vs Student)

5 5 Entity and Entity Set: (Continued) An entity is represented by a set of attributes Student(Name, ID, GPA) Each attribute has a set of permitted values called Domain (value set) ID: positive integer An attribute is a function which maps an entity set into a domain. F(attribute, data value)

6 6 Entity and Entity Set: (Continued) Examples: (Name, Mary), (ID, 23), … Entity Set: Students Faculty Courses

7 7 Relation and Relationship Sets: Relationship is an association among two or more entities Faculty and Course Relationship Set: is a set of similar relationships

8 8 Relation and Relationship Sets: The function that an entity plays in a relationship is called a Role One of the staff is manager Work Staff Staff Manager

9 9 Functionality (Types of relationships) Association among several entities 1. One_To_One Relationship Each entity in either set has at most one association with the member of the other set Example: Chairand Person Students and Address AB a1b1 a2b2 a3b3 a4

10 10 Functionality (Continued) 2. One_To_Many Relationship One entity in set one is associated with zero or more entities in set two, but each entity in set two is associated with at most one entity in set one Example: StudentsAddress John84 Main St. Frostburg 12 1 st Street Washington Lori

11 11 Functionality (Continued) 3. Many_To_Many Relationship No restriction on the either sets of pair of entitles Example: Mark21 1 st Washington 84 Main St. Frostburg Lori62 3 rd Ave Cumberland

12 12 Relationship Department Offering Course Doctor Attending Physician Consulting Physician Patient 1 NN N

13 13 Types of Entities: Strong Entity Weak Entity

14 14 Existence Dependency: If existence of entity ‘a’ depends on the existence of entity ‘b’ a depends on b Example: Account Transaction Weak Entity

15 15 Entity Relationship Diagram Rectangular: Entity Sets Circles: Attributes Diamonds: Relationships Lines: Attribute to entity set and Entity set to relationship

16 16 Entity Relationship Diagram Courses Student Student Course Id GPA Name Course Number Title Cr

17 17 Steps in designing a database using ER Model 1. Identify a. Entity sets b. Relationship sets 2. Identify the attributes for each ES & RS 3. Identify semantic Info. In the relationship sets (functionality among entities) 4. Define the value sets of attributes (types) 5. Organize data into Entity/Relationships Diagram 6. Identify the keys


Download ppt "Chapter Two Database Design (ER Model) Objectives: ER model Type of relationships Role in a relation Concept of Weak entities."

Similar presentations


Ads by Google