Dr. Mohamed Osman Hegaz1 Conceptual data base design: The conceptual models: The Entity Relationship Model.

Slides:



Advertisements
Similar presentations
Entity Relationship Diagrams
Advertisements

Database Design The process of finding user requirement
the Entity-Relationship (ER) Model
Lecture plan Outline of DB design process Entity-relationship model
Chapter 31 Chapter 3 Data Modeling Using the Entity-Relationship Model.
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Lecture Eleven Entity-Relationship Modelling
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Database Systems: Design, Implementation, and Management Tenth Edition
Class Number – CS 304 Class Name - DBMS Instructor – Sanjay Madria Instructor – Sanjay Madria Lesson Title – ER Model.
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
Entity Relationship Diagrams
CS 405G Introduction to Database Systems
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
Data Modeling Using the Entity-Relationship Model
Entity-Relationship modeling Transparencies
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Data Modeling Using the Entity-Relationship Model
Data Modeling Using the Entity-Relationship Model
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Chapter 3 Data Modeling Using the Entity-Relationship (ER) Model.
the Entity-Relationship Model
CONCEPTS OF E-R MODEL. CONTENTS Entity Attributes Data Value Entity Types Types of Entity Types Relationships Relationship Constraints.
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
Entities and Attributes
Chapter 5 Entity–Relationship Modeling
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Data Modeling Using the Entity-Relationship
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Dr. Ahmad R. Hadaegh A.R. Hadaegh California State University San Marcos (CSUSM) Page 1 Entity Relational Diagram (ERD) Modeling This particular lecture.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Entity-Relationship Modeling Based on Chapter 12.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Initial Design of Entity Types for the COMPANY Database Schema Based on the requirements, we can identify four initial entity types in the COMPANY database:
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
CS 405G: Introduction to Database Systems Lecture 2 : Database Design I.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
Database Management Systems MIT Lesson 02 – Database Design (Entity Relationship Diagram) By S. Sabraz Nawaz.
Chapter 3 Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
1 Entity-Relationship Model © Pearson Education Limited 1995, 2005.
Logical Design database design. Dr. Mohamed Osman Hegaz2 Conceptual Database Designing –Provides concepts that are close to the way many users perceive.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Data Modeling Using the Entity-Relationship (ER) Data Model (Based on Chapter 3 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 3)
Data Modelling Using Entity-Relationship (ER) Model
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Data Modeling Using the Entity-Relationship (ER) Data Model.
Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 3: Data Modeling Using the Entity-Relationship (ER) Data Model
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
ENTITY-RELATIONSHIP MODELLING. Objectives: How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated with ER model.
Data Modeling Using the Entity- Relationship (ER) Model
COP Introduction to Database Structures
Comp 1100 Entity-Relationship (ER) Model
Data Modeling Using the Entity- Relationship (ER) Model
Entity- Relationship (ER) Model
ER model Ashima Wadhwa.
Entity-Relationship Model
بسم الله الرحمن الرحيم.
Entity Relationship Diagrams
Initial Design of Entity Types: EMPLOYEE, DEPARTMENT, PROJECT, DEPENDENT Gender.
Database Modeling using Entity Relationship Model (E-R Model)
Conceptual Data Modeling Using Entities & Relationships
Entity Relation Model Tingting Zhang.
Presentation transcript:

Dr. Mohamed Osman Hegaz1 Conceptual data base design: The conceptual models: The Entity Relationship Model

Dr. Mohamed Osman Hegazi2 ER UML Mapping Normalization Design container, policy, Integrity Create & Programming Query processing and transaction Database Administration

Dr. Mohamed Osman Hegaz3 Conceptual Design is an important phase in designing a successful database application. The Entity Relationship (ER) Model is one of the most widely used method for conceptual design. The ER Model can be neatly mapped to a Relational Schema. Conceptual Modeling

Dr. Mohamed Osman Hegaz4 Entities – Entity Sets and Entity Types – Attributes, Keys and Value Sets Relationships – Relationship Types and Sets – Relationship Degree – Roles and Recursive Relationships – Relationship Constraints – Attributes of Relationship Types ER Model Basics

Dr. Mohamed Osman Hegaz5 ER Diagram Basics

6 Defines set of entities that have the same attributes (e. g. EMPLOYEE). Each Entity Type is described by its NAME and Attributes. The Entity Type describes the “Schema” for entities. Entity Type and Entity Set are customarily referred to by the same name. Entity Type

Dr. Mohamed Osman Hegaz7 Key Attributes. Null Valued Attributes. Attribute Types – Composite Vs. Simple Attributes. – Single- valued Vs. Multi- valued Attributes. – Derived Vs. Stored Attributes. Notation Attributes

Dr. Mohamed Osman Hegaz8 Key attribute’s values are distinct for each individual extension in the entity set. A key attribute has its name underlined inside the oval. Key must hold for every possible extension of the entity type. Multiple keys are possible Key Attributes

Dr. Mohamed Osman Hegaz9 A particular entity may not have an applicable value for an attribute. – Phd - Degree: Not applicable for a person with no university education. – Home- Phone: Not known if it exists. – Height: Not known at present time. Type of Null Values – Not Applicable – Unknown – Missing Null Valued Attributes 29/09/2007 9

Dr. Mohamed Osman Hegaz10 Composite attributes can be divided into smaller parts which represent simple attributes with independent meaning. Simple Attribute: B-Date Complex Attribute: Name which is comprised of: First name Mid name Last name Composite Vs. Simple Attributes 29/09/ Week_03

Dr. Mohamed Osman Hegaz11 Simple attributes can either be single-valued or multi- valued. Single-valued: Gender = F Notation Multivalued: Degree = {BSc, Phd} Notation An “attribute” in the relational model is always single valued - Values are atomic! Single Vs. Multivalued Attributes 11

Dr. Mohamed Osman Hegaz12 Some attribute values can be derived from related attribute values: Age  Date - B-day Y-Sal  12 * M-Sal Derived Vs. Stored Attributes

Dr. Mohamed Osman Hegaz13 Relationship Types and Sets. Relationship Degree. Entity Roles and Recursive Relationships. Relationship Constraints. Attributes of Relationship Types. Relationships

Dr. Mohamed Osman Hegaz14 A Relationship is an association among two or more entities (e.g. Students enroll in courses). Relationship Degree The degree of a relationship type is the number of participating entity types. 2 entities: Binary Relationship 3 entities: Ternary Relationship n entities: N-ary Relationship Same entity type could participate in multiple relationship types. Relationship Types and Sets

Dr. Mohamed Osman Hegaz15 Each entity type that participates in a relationship type plays a particular role in the relationship type. The role name signifies the role that a participating entity from the entity type plays in each relationship instance, i.e. it explains what the relationship means. Entity Roles

Dr. Mohamed Osman Hegaz16 Recursive Relationships Same entity type can participate more than once in the same relationship type under different “roles”. Such relationships are called “Recursive Relationships”.

Dr. Mohamed Osman Hegaz17 Kinds of Constraints What kind of constraints can be defined in the ER Model? Cardinality Constraints. Participation Constraints. Together called “Structural Constraints”. Constraints are represented by specific notation in the ER diagram. Relationship Constraints

Dr. Mohamed Osman Hegaz18 Cardinality Ratio The “Cardinality Ratio” for a binary relationship specifies the number of relationship instances that an entity can participate in. – Works-In is a binary relationship. – Participating entities are Department : Employee – One department can have Many employees Ratio is -Cardinality 1 : N

Dr. Mohamed Osman Hegaz19 Possible Cardinality Ratios 1- to- 1 (1: 1) Both entities can participate in only one relationship instance. 1- to Many Many- to- 1 (1: N, N: 1) One entity can participate in many relationship instances. Many- to- Many (N: M) Both entities can participate in many relationship instances.

Dr. Mohamed Osman Hegaz20 Example Cardinality Constraints How many Employees can work in a Department? Many employee can work in only one department How many Employees can be employed by a Department? One department can employ many employees How many managers can a department have? One department can have only one manager How many departments can an employee manage? One employee can have manage only one department

Dr. Mohamed Osman Hegaz21 Representing Cardinality Many employee can work in only one department One department can employ many employees One department can have only one manager One employee can manage only one department

Dr. Mohamed Osman Hegaz22 Existence Dependency Existence dependency indicates whether the existence of an entity depends on its relationship to another entity via the relationship type. Every employee must work for a department - EMPLOYEE is existentially dependent on DEPARTMENT via the Works-In relationship type.

Dr. Mohamed Osman Hegaz23 Kinds of participating constraints TOTAL Participation (Existence Dependency) Constraint: Every employee must work for a department. PARTIAL Participation Constraint: Not every employee is a manager.

Dr. Mohamed Osman Hegaz24 Representing Participation Every employee must work for a department Every department must have a manager Every department must have employees Not every employee is a manager

Dr. Mohamed Osman Hegaz25 Attributes of Relationship Types Relationship Types can also have attributes just as entity types.

Dr. Mohamed Osman Hegaz26 Weak Entities Entity types that do not have key attributes of their own are called “Weak Entities”. A weak entity can be identified uniquely only by considering the primary key of another “Owner” entity. The relationship type that relates a weak entity to its owner is called the “Identifying relationship”.

Dr. Mohamed Osman Hegaz27 Weak Entities Owner and weak entity must participate in a 1: N relationship type. Weak entity must have total participation in the identifying relationship set (existence dependency). Weak entities normally have a “Partial Key”, which is a set of attributes that uniquely identify weak entities related to the same owner entity. Not every existence dependency results in a weak entity !

Dr. Mohamed Osman Hegaz28 Example Weak Entity

Dr. Mohamed Osman Hegaz29 Week_03 SUMMARY OF ER-DIAGRAM

Dr. Mohamed Osman Hegaz30 Exercises: Q1: Describe what entity types represent in an ER model. Q2: Describe what relationship types represent in an ER model. Q3: Describe what attributes represent in an ER model. Q4: Create an ER Diagram for each of the following descriptions:  Each company operates four departments, and each department belongs to one company.  Each department in part (a) employs one or more employees, and each employee works for one department.  Each of the employees in part (b) may or may not have one or more dependant, and each dependant belongs to one employee.  Each employee in part (c) may or may not have employment history.  Represent all ER diagrams described in (a), (b), (c), and (d) as single ER daigarm

Dr. Mohamed Osman Hegaz31 Q5: Consider the company example, on ER diagram:  List the (nonweak ) entity type in the ER.  Is there weak entity type? If so give its name.  List the names of all relation types, and specify the cardinality ratio.  Is there recursive relationship? If so give its name.