Entity-Relationship Modeling I The cautious seldom err. Confucius.

Slides:



Advertisements
Similar presentations
Entity Relationship (ER) Modeling
Advertisements

Database Modeling I The cautious seldom err. Confucius.
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
IT420: Database Management and Organization
Systems Development Life Cycle
Modeling the Data: Conceptual and Logical Data Modeling
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 7.1.
Entity-Relation Modeling Hun Myoung Park, Ph.D., Public Management and Policy Analysis Program Graduate School of International Relations International.
Database Design & Mapping
Systems Analysis Requirements structuring Process Modeling Logic Modeling Data Modeling  Represents the contents and structure of the DFD’s data flows.
Modeling Data The Entity Relationship Model (ER) For Database Design.
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Information Resources Management January 30, 2001.
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 1 Data Models: Degrees of Data Abstraction l Modified ANSI/SPARC Framework.
CHAPTER 2: MODELING DATA IN THE ORGANIZATION © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition Jeffrey.
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Chapter 3)
APPENDIX C DESIGNING DATABASES
Data Modeling 1 Yong Choi School of Business CSUB.
Data Modeling and the Entity-Relationship Model Chapter Four DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
Entity-Relationship modeling Transparencies
1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name Position (123) University Name.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
Chapter 5 Entity Relationship (ER) Modelling
Chapter 5 Entity–Relationship Modeling
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
IS 325 Notes for Wednesday September 4, Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments.
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
DATABASEMODELSDATABASEMODELS  A database model ◦ defines the logical design of data. ◦ Describes the relationships between different parts of data.
Concepts and Terminology Introduction to Database.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Entity-Relationship Modeling Based on Chapter 12.
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-1 David M. Kroenke’s, 10 th ed. Chapter.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
1 A Demo of Logical Database Design. 2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational model.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
Databases Illuminated Chapter 3 The Entity Relationship Model.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 4 ENTITY RELATIONSHIP (ER) MODELING Instructor Ms. Arwa Binsaleh 1.
1 Database Systems Entity Relationship (E-R) Modeling.
The Entity-Relationship Model, P. I R. Nakatsu. Data Modeling A data model is the relatively simple representation, usually graphic, of the structure.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
ENTITY RELATIONSHIP DIAGRAM. Objectives Define terms related to entity relationship modeling, including entity, entity instances, attribute, relationship.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Entity-Relationship Model
Overview of Entity‐Relationship Model
Database Systems: Design, Implementation, and Management Tenth Edition
Data Modeling for Database Design 2
Review of Week 1 Database DBMS File systems vs. database systems
Chapter 4 Entity Relationship (ER) Modeling
Entity-Relationship Diagram (ERD)
Presentation transcript:

Entity-Relationship Modeling I The cautious seldom err. Confucius

Class Outline  What are the steps in designing databases?  Why is modeling important?  What are the basic elements of a database model?  How are the following represented in Chen’s relational database model? l entity l attribute l degree of relationship l connectivity l cardinality l binary M:N relationships l participation

Data Modeling  A model is a simplified representation (usually a graphic) of a complex object in reality to make it understandable  If the elements in the model are correctly associated with elements in reality, the model can be used to solve problems in reality (e.g., engineer’s model to determine a bridge’s weight tolerance; if the model is incorrect...)  an ER model is an integrated set of concepts that describes data, relationships between data, and the constraints on the data as they are used within a specific organization; a data model renders organization’s (users’) view of objects and/or events and their associations  ER model is a blueprint from which a well-structured database is created  ER models are independent of details of implementation

E-R Modeling Concepts Objects Entities Relationships Attributes Relationship Type Degree Values Domains 1 : 1 1 : N M : N Mandatory Optional Connectivity Participation Recursive Binary Ternary N-ary Cardinality

Entities  Entity l Something that can be identified in the users’ environment about which we want to store data; typically is a noun l Entities or objects must have occurrences that can be uniquely identified l Identified by an organization or its users l Consists of tangible or intangible objects or events  Entity Instance l A single entity occurrence or instance within a collection of entities e.g., STUDENT is an entity; Annie Abel is an entity instance as are Bob Brown and Cathy Chen. STUDENT

Attributes  properties that describe characteristics of an entity - assumed all instances of a given entity have the same attributes l use atomic attributes, those that cannot be divided further (e.g., not composite attributes (e.g., use last name & first name, not name) l do not use derived attributes (attributes that can be calculated using other attributes; e.g., age) l use single value attributes not multi-valued (e.g., medication1, medication2, etc.) l multi-valued attributes, if they have their own important attributes should be elevated to entities e.g., attributes of the entity STUDENT might include name, address, etc. STUDENT birth datefirst name last name photophone #

Identifier  Each entity occurrence has a unique identifier  The identifier is an attribute (or group of attributes) that describes or identifies each entity occurrence  An identifier should be unique to each occurrence  Referred to as a ‘primary key’ in relational models STUDENT e.g., in the list of potential attributes of the entity STUDENT, the identifier could be Student Number. StudentID

Relationships  Association or connection between two or more entities l Usually a verb l HAS-A is also a common relationship (EMPLOYEE-has a-DEPENDENT) l E-R model also contains relationship classes STUDENT takes COURSE StudentIDCourseID

Degree of Relationship: Binary In a binary relationship, two entities are associated. This is the most common degree of relationship. VACATIONER takes TRIP EMPLOYEE DEPARTMENT works for

Degree of Relationship: Ternary In a ternary relationship, three entities are associated creat e DESIGNER WRITERILLUSTRATORCUSTOMERWAREHOUSE ITEM order

Degree of Relationship: Unary (Recursive) In a recursive relationship, one entity is associated with itself TEAM plays COURSE requires

ChildToy EmployeeOffice MusicianSong One-to-Many One-to-One Many-to-Many 1M M 1 N 1 Connectivity  Connectivity describes constraints on relationship (also referred to as “maximum cardinality”)  Number of instances of entity B that can (or must) be associated with each instance of entity A has sings

Representing M:N binary relationships  M:N relationships are represented by two 1:M relationships.  the relationship is itself an entity, called a composite entity (rectangle around the diamond)  The composite entity often has its own attributes STUDENTCLASS enrolls in MN STUDENTCLASS enrolls in MM DateMark 11

Cardinality  Cardinality is the specific number of entity occurrences associated with one occurrence of the related entity  often referred to as ‘business rules’ because cardinality is usually determined by organizational policy DoctorPatients 1M e.g., at a clinic, a given doctor may not have any patients or up to ten patients. A patient may not have any doctor (waiting to be seen) or may be assigned to one doctor. (0,10)(0,1) has

Occurrences Diagram Pictorial mapping of the occurrences between two entities assists in understanding connectivity, cardinality D1P1D2 P2D3P3D4P4D5P5D6 P6D1P1D2 P2D3P3D4P4D5P5D6 P6 A doctor may see between 0 and 10 patients; a patient may only be seen by 0 or 1 doctors. 1 doctor may see many patients (1:M)

Relationship Participation  Also referred to as “minimum cardinality”  Mandatory Participation l An instance of a given entity must definitely match an instance of a second entity l e.g., each student must enroll in exactly one course  Optional Participation l An instance of a given entity does not necessarily participate in the relationship l lower bound of cardinality is zero l e.g., a faculty member teaches zero, one, or two courses makes 1 MEMBER DONATION OPTIONALMANDATORY N (0,N)(1,1) a member may or may not make a donation but a donation must be associated with a member

 From the DOCTOR perspective: –a doctor may have many patients (M patients of 1:M connectivity) –a doctor does not necessarily have patients (optional participation of patients, cardinality is (0,N))  From the PATIENT perspective: –A patient has (associated with) one and only one doctor (1 doctor of 1:M connectivity) –A patient may or may not have (associated with) a doctor (optional participation, cardinality is (0,1)) DOCTORPATIENT has 1M (0,N)(0,1) Example: Doctor & Patient

Steps in Entity-Relationship Modeling 1. Identify entities 2. Identify relationships 3. Determine relationship type 4. Determine level of participation 5. Assign an identifier for each entity 6. Draw completed E-R diagram 7. Deduce a set of preliminary skeleton tables along with a proposed primary key for each table (using rules provided) 8. Develop a list of all attributes of interest

E-R Method Example: Scheduling DB  Step 1. Identify entity types APPOINTMENTDOCTORPATIENT u Step 2. Identify relationships DOCTORAPP has PATIENTAPP has

Schedule Database (cont’d)  Step 3. Determine relationship type. Ask: l How many appointments can a patient have? Can an appointment involve many patients? Each patient may have many appointments but an appointment involves only one patient. The relationship type is one-to-many or: PATEINTAPP has 1N How many appointments can a doctor have? Can many doctors be involved in one appointment?. The relationship type is many-to-many because a doctor may have many appointments and an appointment may involve 1 or more doctors. DOCTORAPP has NM

Schedule Database (cont’d)  Step 4. Determine level of participation l Since each patient does not need to have an appointment (walk-in) it is considered optional. BUT, each appointment must have a patient, hence it is considered mandatory. PATEINTAPP has 1N (0, N) (1, 1) l For the doctor-appointment relationship, a doctor does not need to have an appointment so it is considered optional. BUT, each appointment must have a doctor, hence it is considered mandatory. MN DOCTORAPP has (0, N)(1,M)

Schedule Database (cont’d)  Step 5. Assign an identifier for each entity l DoctorId, PatientId, AppointmentId  Step 6. Draw completed E-R diagram Patient DoctorApp has DoctorId,... AppId,... PatientID,... N 1 NM (0,N)(1,M) (1,1) (0,N)

Schedule Database (cont’d)  Step 6. Draw completed E-R diagram - resolve M:N relationships Patient DoctorApp has DoctorId,... AppId,... N 1 NM (0,N)(1,M) (1,1) (0,N) AppId... DoctorId... PatientID,...