Database Design: ER Modelling (Continued)

Slides:



Advertisements
Similar presentations
Conceptual / semantic modelling
Advertisements

Logical Database Design Reading: C&B, Chap 17. Dept. of Computer Science, University of Aberdeen2 In this lecture you will learn What is logical database.
Database Design: ER Modelling
1 SA0951a Entity-Relationship Modelling. 2 What is it about? ER model is used to show the Conceptual schema of an organisation. Independent of specific.
Developing ER-Diagram
the Entity-Relationship (ER) Model
Relational Database Design Via ER Modelling
Lecture plan Outline of DB design process Entity-relationship model
Chapter 12 Enhanced Entity-Relationship Modeling Transparencies © Pearson Education Limited 1995, 2005.
Logical Database Design
CSC271 Database Systems Lecture # 22. Summary: Previous Lecture  Applying Database SDLC on DreamHome  Database planning  System definition  Requirements.
Chapter 6 Methodology Logical Database Design for the Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Pertemuan Entity Relationship Diagram
System Analysis - Data Modeling
Chapter 6 Methodology Conceptual Databases Design Transparencies © 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.
Lecture Eleven Entity-Relationship Modelling
Methodology Logical Database Design for the Relational Model
Lecture Fourteen Methodology - Conceptual Database Design
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
1 Database Systems: A Practical Approach to Design, Implementation and Management International Computer Science S. Carolyn Begg, Thomas Connolly Lecture.
Methodology Conceptual Database Design
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
CSC271 Database Systems Lecture # 21. Summary: Previous Lecture  Phases of database SDLC  Prototyping (optional)  Implementation  Data conversion.
Entity-Relationship modeling Transparencies
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Computer System Analysis Chapter 10 Structuring System Requirements: Conceptual Data Modeling Dr. Sana’a Wafa Al-Sayegh 1 st quadmaster University of Palestine.
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.
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
Methodology Conceptual Databases Design
Chapter 5 Entity–Relationship Modeling
CSCI 3140 Module 2 – Conceptual Database Design Theodore Chiasson Dalhousie University.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
1 Pertemuan > > Matakuliah: >/ > Tahun: > Versi: >
9/10/2012ISC 329 Isabelle Bichindaritz1 Entity Relationship (E-R) Modeling.
9/19/2012ISC329 Isabelle Bichindaritz1 Conceptual Data Modeling.
Methodology: Conceptual Databases Design
Team Dosen UMN Database Design Connolly Book Chapter
© Pearson Education Limited, Chapter 9 Logical database design – Step 1 Transparencies.
Entity-Relationship Modeling Based on Chapter 12.
Chapter 8 Methodology - Conceptual Database Design Chapter 15 in Textbook.
1 Chapter 11 Entity-Relationship Modeling Transparencies Last Updated: 25 April 2011 By M. Arief
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Part4 Methodology of Database Design Chapter 07- Overview of Conceptual Database Design Lu Wei College of Software and Microelectronics Northwestern Polytechnical.
1 Entity-Relationship Model © Pearson Education Limited 1995, 2005.
Conceptual Databases Design Step 1 © Pearson Education Limited 1995, 2005.
Modelling Methodologies Chapter 16, 17, 18. Modeling Methodologies2 Database Design Physical DB design Logical DB design Conceptual DB design Hardware.
1 Database Systems Entity Relationship (E-R) Modeling.
CSC271 Database Systems Lecture # 23. Summary: Previous Lecture  Database design using ER modeling  Concepts of ER model  Entities  Relationships.
DBMS ER model-2 Week 6-7.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
CSCI 6315 Applied Database Systems Review for Midterm Exam I Xiang Lian The University of Texas Rio Grande Valley Edinburg, TX 78539
Methodology - Logical Database Design. 2 Step 2 Build and Validate Local Logical Data Model To build a local logical data model from a local conceptual.
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
Methodology Conceptual Databases Design
Chapter # 3 Data Modeling Using the Entity-Relationship (ER) Model
Methodology Logical Database Design for the Relational Model
COP Introduction to Database Structures
Conceptual Design & ERD Modelling
TMC2034 Database Concept and Design
Methodology Conceptual Database Design
Entity-Relationship Modelling
Entity-Relationship Modeling
Conceptual Database Design
Entity-Relationship Modeling
Entity-Relationship Modelling
Methodology Conceptual Databases Design
Presentation transcript:

Database Design: ER Modelling (Continued) Reading: C&B, Chaps 11,12&16

In this lecture you will learn Structural constraints Enhanced ER modelling Step-by-step procedure for conceptual data modelling Department of Computing Science, University of Aberdeen

Structural constraints Apply on the entity types that participate in a relationship Come from the real world constraints in client’s domain We focus on binary relationships which have two participating entity types Three types of binary relations one-to-one – 1:1 one-to-many – 1:* many-to-many - *:* Department of Computing Science, University of Aberdeen

Diagrammatic Representation of 1:1 relationships For example, Staff Manages Branch Meaning At least one and a maximum of one staff manages a branch A member of staff manages zero or one branch Staff Branch Manages 1..1 0..1 Department of Computing Science, University of Aberdeen

Diagrammatic representation of 1:* For example, Staff oversees PropertyForRent Meaning At least zero and a maximum of one staff oversees a property A member of staff oversees zero or many properties Staff PropertyForRent Oversees 0..1 0..* Department of Computing Science, University of Aberdeen

Diagrammatic representation of *:* For example, NewsPaper Advertises PropertyForRent Meaning At least zero and a maximum of many newspapers advertise a property A newspaper advertises one or many properties Advertises Newspaper PropertyForRent 0..* 1..* Department of Computing Science, University of Aberdeen

Multiplicity Range – Min..Max Used to specify the number of possible occurrences of each participating entity type in a relationship Multiplicity range is for this specification has two parts Min Max For example, for a multiplicity range of 0..1 Min = 0 Max = 1 Max of a multiplicity range denotes Cardinality Min of a multiplicity range denotes Participation Department of Computing Science, University of Aberdeen

Department of Computing Science, University of Aberdeen Enhanced ER Modelling ER modelling does not capture all the semantics of client’s domain, such as ‘ISA’ (‘is a’) relationship or specialization-generalization ‘Manager’ entity type ‘is a’ subentity of ‘Staff’ entity ‘HASA’ (‘has a’) relationship or ‘is-part-of’ relationship or aggregation A relationship between the ‘whole’ and the ‘part’ Branch (whole) Has Staff (part) Composition is a special form of aggregation – ‘part’ is strongly owned by the ‘whole’ Enhanced ER models represent the above relationships Therefore capture client’s domain more comprehensively Department of Computing Science, University of Aberdeen

Diagrammatic Representation of ‘ISA’ relationship Staff staffNo {PK} name position salary Superclass Subclass {Optional, Or} Specialization/generalization indicator Constraints Manager mgrStartDate bonus Supervisor Department of Computing Science, University of Aberdeen

Diagrammatic Representation Aggregation Composition Indicator Staff Has Branch staffNo branchNo Aggregation indicator Part Whole Department of Computing Science, University of Aberdeen

Department of Computing Science, University of Aberdeen Summary So far …. ER modelling technique helps us to model data from any domain The main components are Entities Relationships Attributes Multiplicity constraints Superclass-subclass relationships Diagrammatic notations for all the above You will also learn some details about ER modelling in the practical Some aspects of ER Modelling such as relationship modelling are better learnt with examples We need to now learn how to use this knowledge to actually model data from a particular domain We use a step-by-step procedure as described next This means we build EER models incrementally Department of Computing Science, University of Aberdeen

Step-by-step procedure for conceptual design Identify entity types Identify relationship types Identify and associate attributes with entity or relationship types Determine attribute domains Determine candidate, primary and alternate key attributes Consider use of enhanced modelling concepts (optional) Check model for redundancy Validate conceptual model against user transactions Review conceptual data model with user We will focus on only some of these steps (see C&B for more) Department of Computing Science, University of Aberdeen

Department of Computing Science, University of Aberdeen Identify entity types No well defined procedure Take a very selective view of the world Determine the main concepts in the domain about which the database has to store data In the user requirement specification, identify Nouns and noun phrases Places, people and concepts Objects with independent existence Watch out for synonyms and homonyms Draw the entity types in the ER diagram Document entity details in the data dictionary Department of Computing Science, University of Aberdeen

Department of Computing Science, University of Aberdeen Example In the DreamHome domain the main concepts are: Property For Rent – the whole business revolves around this concept Client – once again an important concept for the business Owner of the property Staff and the Branches they manage Department of Computing Science, University of Aberdeen

Identify relationship types Determine the relationships among the entity types identified in the previous step Relationships may open up new entity types!! In the user requirement specification, identify Verbs and verb groups (verbal expressions) First identify binary relationships Only then identify complex relationships Check the possibility of a relationship between each pair of entity types Time consuming but possible on smaller design problems Determine the structural constraints Draw the relationship types in the ER diagram Add information about structural constraints to the ER diagram Document relationship details in the data dictionary Department of Computing Science, University of Aberdeen

Specify Structural Constraints A relationship has some participating entities E.g. Staff manage Branch has Staff and Branch as the participating entities The main task in relationship specification is to specify structural constraints (min-max constraints) on the participating entities E.g. Many Staff might manage a Branch These constraints specify how many instances of data from one participating entity correspond to one instance from the other participating entity E.g., One Branch may have many Staff Department of Computing Science, University of Aberdeen

Identify and associate attributes (I) For each entity/relationship identified in the previous steps Determine required information about that entity/relationship if an attribute is composite If the user wants to access parts of the composite attribute Represent it in terms of the constituent simple attributes If an attribute is multi-valued Model it as a separate entity at this stage Or Leave it alone at this stage - logical design process will anyway model it as a separate relation Department of Computing Science, University of Aberdeen

Identify and associate attributes (II) Alternatively make a list of attributes from user requirements specification Tick them off the list as you associate them with an entity/relationship When attributes appear to be associated with more than one entity/relationship, either have a potential relationship between the entity types Or have a case for applying generalization/specialization Add attribute information to the ER diagram and data dictionary Department of Computing Science, University of Aberdeen

Guidelines for identifying primary key The candidate key with the minimal set of attributes The candidate key that is least likely to have its values changed The candidate key with fewest characters The candidate key with smallest maximum values The candidate key that is easiest to use from the user’s point of view Department of Computing Science, University of Aberdeen

Putting it all together So far we have learnt step-by-step procedure for collecting data models of components of the conceptual design These component data models need to be put together into an ER diagram showing the overall data model for the domain In the next slide we show one possible data model for the DreamHome domain. Please note that in the earlier lecture and the practical (practical 4) you will see several data models for the DreamHome domain Each of them may capture the domain requirements to a different degree of accuracy Department of Computing Science, University of Aberdeen

Conceptual Design of DreamHome Department of Computing Science, University of Aberdeen

Department of Computing Science, University of Aberdeen Transaction pathways An approach to validate EER model by manually executing user specified transactions The entities and relationships involved in the execution are directly marked on the EER diagram Not possible for large number of transactions – the diagram will become unreadable Useful visualization showing areas of the diagram that are essential for transactions and areas of the diagram that are not required for transactions Department of Computing Science, University of Aberdeen

Department of Computing Science, University of Aberdeen Summary Conceptual design yields an EER Model EER Model is a high level description of data represent data semantics in a way that non-experts (client’s) can read them and validate them (hopefully!) is subjective – depends upon the selective view of the data taken by the designer Entity vs attribute dilemma, entity vs relationship dilemma, binary vs tertiary relationship dilemma and so on Department of Computing Science, University of Aberdeen