Bordoloi CMIS 450 Database Design Dr. Bijoy Bordoloi Entity Relationship (E-R) Model.

Slides:



Advertisements
Similar presentations
the Entity-Relationship (ER) Model
Advertisements

Entity-Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Systems Development Life Cycle
Data Modeling is an Analysis Activity
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
1 MIS 340: Data Modeling 2 Yong Choi School of Business CSUB.
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Chapter 3: Modeling Data in the Organization
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.
Chapter 3 © 2005 by Prentice Hall 1 Objectives Definition of terms Definition of terms Importance of data modeling Importance of data modeling Write good.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Entity Relationship Diagrams (ERDs)
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 7th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R.
1 © Prentice Hall, 2002 CMIS564: E/R Modeling Dr. Bordoloi Based on Chapter 3; Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
3.1 CSIS 3310 Chapter 3 The Entity-Relationship Model Conceptual Data Modeling.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
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 5 1 © Prentice Hall, 2002 Chapter 5: Transforming EER Diagrams into Relations Mapping Regular Entities to Relations 1. Simple attributes: E-R attributes.
Chapter 3: Modeling Data in the Organization
Dr. Mohamed Osman Hegaz1 Conceptual data base design: The conceptual models: The Entity Relationship Model.
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
1 Data Modeling 2 Yong Choi School of Business CSUB.
Chapter 5 Entity–Relationship Modeling
Chapter 2: Modeling Data in the Organization
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
DATABASEMODELSDATABASEMODELS  A database model ◦ defines the logical design of data. ◦ Describes the relationships between different parts of data.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 2: Modeling Data in the Organization.
© 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 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
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:
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.
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.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 4 ENTITY RELATIONSHIP (ER) MODELING Instructor Ms. Arwa Binsaleh 1.
Entity Relationship Modeling
advanced data modeling
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
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.
Bordoloi CMIS 450: Database Design Dr. Bijoy Bordoloi Transforming E/R Diagrams to Relations.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 3: Modeling Data in the Organization Modern Database Management 9 th Edition Jeffrey.
IS 4420 Database Fundamentals Chapter 3: Modeling Data in the Organization Leon Chen.
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
Entity-Relationship Model
Overview of Entity‐Relationship Model
Entity Relationship Diagrams
Review of Week 1 Database DBMS File systems vs. database systems
Chapter 3: Modeling Data in the Organization
Entity-Relationship Diagram (ERD)
Entity Relation Model Tingting Zhang.
Presentation transcript:

Bordoloi CMIS 450 Database Design Dr. Bijoy Bordoloi Entity Relationship (E-R) Model

Bordoloi E-R Modeling and Logical Database Design  The Entity Relationship Model  The Relational Model  Transforming E-R Diagrams into Relations  Normalization

Bordoloi E-R Model Constructs EntitiesEntities RelationshipsRelationships CardinalityCardinality AttributesAttributes Sub-entities (EER)Sub-entities (EER) ExamplesExamples

Bordoloi Definition of Entity An entity type is a set of entity instances sharing the same common properties (‘attributes’), characterized by:An entity type is a set of entity instances sharing the same common properties (‘attributes’), characterized by: –Name - a noun, e.g., EMPLOYEE –Description - defines which instances belong to the entity type E –Identifier - a property (or a joint set of properties) which uniquely identify entity instances An entity instance is a single identifiable real- world thing, e.g., Jack SprattAn entity instance is a single identifiable real- world thing, e.g., Jack Spratt

Bordoloi Entity Types DEPARTMENT EMPLOYEE PROJECT SUPPLIER

Bordoloi Attributes Any property of an owner entityAny property of an owner entity Attribute typeAttribute type –A set of attribute instances expressing the same property of an entity type, e.g., Gender Attribute instanceAttribute instance –A particular property of an individual entity instance, e.g., Male

Bordoloi Attributes EMPLOYEE EMP-ID SS-NUM EMP- NAME PHONE

Bordoloi An attribute (or a joint set of attributes) which uniquely identify the entity instances of an entity An attribute (or a joint set of attributes) which uniquely identify the entity instances of an entity An identifier should be: An identifier should be: - Unique and known (must not be ‘NULL’) - Unique and known (must not be ‘NULL’) - Short (preferably) - Short (preferably) - Stable (preferably) - Stable (preferably) Identifier

Bordoloi What would you choose as the Identifier of the entity type EMPLOYEE? EMPLOYEE EMP-ID SS-NUM EMP- NAME PHONE

Bordoloi What Should an Entity Be? SHOULD 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 –Must have an identifier SHOULD NOT BE:SHOULD NOT BE: –A user of the database system –An output of the database system (e.g. a report)

Bordoloi Inappropriate entities System user System output Appropriate entities Figure 3-4

Bordoloi Entity B is existence-dependent on entity A whenEntity B is existence-dependent on entity A when –Some instance of A must exist before B can exist –If A ceases to exist, B must also cease to exist An independent entity is not existence-dependent on any other entityAn independent entity is not existence-dependent on any other entity Independent Entity – Strong EntityIndependent Entity – Strong Entity Dependent Entity – Weak EntityDependent Entity – Weak Entity Diagramming conventionDiagramming convention Dependent and Independent Entities

Bordoloi Typically the identifier of a weak entity is a composite identifier which includes the identifier of the entity which the weak entity is existence- dependent uponTypically the identifier of a weak entity is a composite identifier which includes the identifier of the entity which the weak entity is existence- dependent upon Diagramming conventionDiagramming convention Dependent and Independent Entities

Bordoloi Dependent and Independent Entities ExamplesExamples OFFERINGCOURSE TASKPROJECT DEPENDS ON

Bordoloi Relationships An association between two or more entities, of significance to the enterpriseAn association between two or more entities, of significance to the enterprise Relationships are named with a verb an depicted as lines between entitiesRelationships are named with a verb an depicted as lines between entities SUPPLIER PART EMPLOYEE COMPANY SHIP WORK FOR

Bordoloi Degree The degree of a relationship is the number of associated entitiesThe degree of a relationship is the number of associated entities Relationships are usually of degree 2 (binary) - but sometimes can be unary or of higher degree (N-ary)Relationships are usually of degree 2 (binary) - but sometimes can be unary or of higher degree (N-ary)

Bordoloi Binary Relationships The relationship involves at the most only two entitiesThe relationship involves at the most only two entities SUPPLIERPART EMPLOYEECOMPANY SHIP WORK FOR

Bordoloi Unary Relationships Relationships may associate an entity with itself, i.e., when an instance of an entity is related to some other instance(s) of the same entity.Relationships may associate an entity with itself, i.e., when an instance of an entity is related to some other instance(s) of the same entity. EMPLOYEE Married_to

Bordoloi Ternary Relationship The relationship involves three entitiesThe relationship involves three entities COMPANY PRODUCT AGENT SELL

Bordoloi Several relationships may exist between the same entitiesSeveral relationships may exist between the same entities The name and description distinguishes different relationships between the same entitiesThe name and description distinguishes different relationships between the same entities Relationships EMPLOYEEDEPARTMENT MANAGE FORMERLY WORKED IN WORK IN

Bordoloi Cardinality Constraints Cardinality Constraints A binary relationship (E 1,E 2 ) has two directions, left and rightA binary relationship (E 1,E 2 ) has two directions, left and right Each direction has cardinality constraints, described as maximum and mimimu.Each direction has cardinality constraints, described as maximum and mimimu.

Bordoloi Cardinality Constraints Cardinality Constraints - the number of instances of one entity that can or must be associated with each instance of another entity.Cardinality Constraints - the number of instances of one entity that can or must be associated with each instance of another entity. Maximum Cardinality (can be)Maximum Cardinality (can be) –The maximum number Minimum Cardinality (must be) –If zero, then optional –If one or more, then mandatory

Bordoloi Maximum Cardinality Maximum Cardinality The maximum cardinality of a direction E 1 to E 2 indicates how many e 2 ’s can match a given e1 (at most)The maximum cardinality of a direction E 1 to E 2 indicates how many e 2 ’s can match a given e1 (at most) Cardinality is denoted as MaxLeft - MaxRightCardinality is denoted as MaxLeft - MaxRight –1-1 –1-N –N-1 –M-N

Bordoloi Cardinality Cardinality EMPLOYEEDEPARTMENT  WORK-IN ONE DEPARTMENT EACH EMPLOYEE MANY EMPLOYEES EACH DEPARTMENT MANYONE

Bordoloi Examples of Cardinality Examples of Cardinality EMPLOYEEDEPARTMENT N1 WORKS-IN E1E1 E2E2 E3E3 E4E4 D1D1 D2D2 D3D3 D4D4

Bordoloi Examples of Cardinality Examples of Cardinality 11 MN E1E1 E2E2 E3E3 E4E4 D1D1 D2D2 D3D3 D4D4 E1E1 E2E2 E3E3 E4E4 D1D1 D2D2 D3D3 D4D4 MANAGE FORMERLY WORKED-IN

Bordoloi Minimum Cardinality Minimum Cardinality Minimum cardinality is specified as zero to oneMinimum cardinality is specified as zero to one EMPLOYEEDEPARTMENT  WORK IN ONE DEPARTMENT EACH EMPLOYEE ZERO EMPLOYEES EACH DEPARTMENT ZEROONE

Bordoloi Minimum Cardinality Minimum Cardinality For the purpose of our course, we will use:For the purpose of our course, we will use:   Instructor teaches One to many (maximum cardinality) Mandatory Optional (minimum cardinality)

Bordoloi Summary of Cardinality Minimum and maximum cardinality is specified for each direction of a relationshipMinimum and maximum cardinality is specified for each direction of a relationship Maximum cardinality is either one or many for each directionMaximum cardinality is either one or many for each direction Minimum cardinality is either zero or one for each directionMinimum cardinality is either zero or one for each direction

Bordoloi Terminology Terminology A single-valued relationship (from entity A to entity B) has maximum cardinality of one (from A to B)A single-valued relationship (from entity A to entity B) has maximum cardinality of one (from A to B) A multi-valued relationship has maximum cardinality of manyA multi-valued relationship has maximum cardinality of many When we speak of single-valued and multi- valued relationships, a direction is implicitWhen we speak of single-valued and multi- valued relationships, a direction is implicit