Methodology Logical Database Design for the Relational Model

Slides:



Advertisements
Similar presentations
The transformation of an ER or EER model into a relational model
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.
Relational Database Design Via ER Modelling
Logical Database Design
Chapter 6 Methodology Logical Database Design for the Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Chapter 6 Methodology Conceptual Databases Design Transparencies © Pearson Education Limited 1995, 2005.
Lecture Eleven Entity-Relationship Modelling
1 Methodology : Conceptual Databases Design © Pearson Education Limited 1995, 2005.
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Modeling & Designing the Database
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
LOGICAL DATABASE DESIGN
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
Logical Database Design Nazife Dimililer. II - Logical Database Design Two stages –Building and validating local logical model –Building and validating.
Mapping ERM to relational database
Entity-Relationship modeling Transparencies
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Web-Enabled Decision Support Systems
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Methodology - Conceptual Database Design Transparencies
Methodology Conceptual Databases Design
Chapter 5 Entity–Relationship Modeling
1 Chapter 15 Methodology Conceptual Databases Design Transparencies Last Updated: April 2011 By M. Arief
1 Pertemuan > > Matakuliah: >/ > Tahun: > Versi: >
10/3/2012ISC329 Isabelle Bichindaritz1 Logical Design.
Chapter 9 Methodology - Logical Database Design Chapter 16 in Textbook.
CSCI 3140 Module 3 – Logical Database Design for the Relational Model Theodore Chiasson Dalhousie University.
Methodology: Conceptual Databases Design
DATABASE MGMT SYSTEM (BCS 1423) Chapter 5: Methodology – Conceptual Database Design.
Team Dosen UMN Database Design Connolly Book Chapter
Chapters 15 &16 Conceptual and Logical Database Design Methodology.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling 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.
Chapter 11 & 12 Entity-Relationship (E-R) Model Characteristics of E-R Model Components of E-R Model Example of E-R Model Enhanced E-R Model.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
1 Entity-Relationship Model © Pearson Education Limited 1995, 2005.
1 Chapter 17 Methodology - Local Logical Database Design.
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
Chapter 17 Logical Database Design for the Relational Model Pearson Education © 2009.
ER/EER to Relational Mapping Chapter 9. STEP 1 ENTITY TYPE E (non weak) -> NEW RELATION T RELATION T: – includes all simple attributes (non composite,
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 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
1 Database Systems Entity Relationship (E-R) Modeling.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
Logical Database Design Transparencies 1. ©Pearson Education 2009 Objectives How to create a set of tables from an ER model. How to check that the tables.
Logical Design 12/10/2009GAK1. Learning Objectives How to remove features from a local conceptual model that are not compatible with the relational model.
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.
April 20022/CS/3X1 Database Design Design method John Wordsworth Department of Computer Science The University of Reading Room.
Methodology Conceptual Databases Design
Methodology Logical Database Design for the Relational Model
Conceptual Design & ERD Modelling
Relational Database Design by ER- and EER-to- Relational Mapping
Methodology Conceptual Database Design
Logical Database Design for the Relational Model
Logical Database Design for the Relational Model
Chapter Design Methodology Pearson Education © 2009.
Conceptual Database Design
Chapter 4+17 The Relational Model Pearson Education © 2014.
Entity-Relationship Modeling
Logical Database Design
Methodology Conceptual Databases Design
Methodology - Global Logical Database Design
Presentation transcript:

Methodology Logical Database Design for the Relational Model Chapter 17 Methodology Logical Database Design for the Relational Model

Step 2 Build and Validate Logical Data Model To translate conceptual data model into logical data model and then to validate model to check that it is structurally correct using normalization and supports required transactions

Step 2 Build and Validate Logical Data Model Step 2.1 Derive relations for logical data model To create relations for logical data model to represent entities, relationships, and attributes that have been identified

Conceptual data model for Staff view showing all attributes

Step 2.1 Derive relations for logical data model (1) Strong entity types For each strong entity in data model, Create relation that includes all simple attributes of entity For composite attributes, include only constituent simple attributes Weak entity types For each weak entity in data model, Primary key of weak entity is partially or fully derived from each owner entity

Step 2.1 Derive relations for logical data model (3) One-to-many (1:*) binary relationship types For each 1:* binary relationship, Entity on ‘one side’ of relationship designated as parent entity Entity on ‘many side’ designated as child entity Represent relationship by posting copy of primary key attribute(s) of parent entity into relation representing child entity Acts as foreign key If relationship has attributes Post attributes to child entity along with copy of parent entity primary key

Step 2.1 Derive relations for logical data model (4) One-to-one (1:1) binary relationship types Cardinality cannot be used to identify parent and child entities Participation constraints used Options: Represent relationship by combining entities involved into one relation Create two relations and post copy of primary key from one relation to other Consider the following: (a) mandatory participation on both sides of 1:1 relationship (b) mandatory participation on one side of 1:1 relationship (c) optional participation on both sides of 1:1 relationship

Step 2.1 Derive relations for logical data model (a) Mandatory participation on both sides of 1:1 relationship Combine entities involved into 1 relation Choose one primary key of original entities to be primary key of new relation Other primary key (if one exists) used as alternate key If relationship has attributes → include in merged relation (b) Mandatory participation on one side of a 1:1 relationship Identify parent and child entities using participation constraints Entity with optional participation in relationship designated as parent Entity with mandatory participation designated as child Place copy of primary key of parent in relation representing child If relationship has one or more attributes → post to child relation following primary key Preference example

Conceptual data model for Staff view showing all attributes

Step 2.1 Derive relations for logical data model (c) Optional participation on both sides of a 1:1 relationship Designation of parent and child entities arbitrary unless more about relationship known If one entity closer to being mandatory → choose as child ‘Staff Uses Car’ Example

Step 2.1 Derive relations for logical data model (5) One-to-one (1:1) recursive relationships Follow rules for participation for 1:1 relationship Mandatory participation on both sides Represent recursive relationship as single relation with two copies of primary key One copy => primary key; other copy => foreign key, should be renamed Mandatory participation on only one side Options: Create single relation with two copies of primary key Create new relation to represent relationship New relation would only have two attributes => both copies of primary key Copy of primary keys act as foreign keys, should be renamed to indicate purpose Optional participation on both sides Create new relation as described above

Step 2.1 Derive relations for logical data model (6) Superclass/subclass relationship types Identify superclass entity as parent entity and subclass entity as child entity Options on representation of relationship Selection of most appropriate option dependent on factors: Disjointness and participation constraints on superclass/subclass relationship Whether subclasses involved in distinct relationships Number of participants in superclass/subclass relationship

Guidelines for representation of superclass / subclass relationship

Representation of superclass / subclass relationship based on participation and disjointness

Step 2.1 Derive relations for logical data model (7) Many-to-many (*:*) binary relationship types Create relation to represent relationship and include any attributes that are part of relationship Post copy of primary key attribute(s) of entities that participate in relationship into new relation - act as foreign keys Foreign keys also form primary key of new relation Possibly in combination with other attributes of relationship See ‘Client Views PropertyForRent’ relationship

Step 2.1 Derive relations for logical data model (8) Complex relationship types Create relation to represent relationship and include any attributes Post copy of primary key attribute(s) of entities that participate in complex relationship into new relation - act as foreign keys Foreign keys that represent ‘many’ relationship (for example, 1..*, 0..*) generally will also form primary key of new relation Possibly in combination with other attributes of relationship

Step 2.1 Derive relations for logical data model (9) Multi-valued attributes Create new relation to represent multi-valued attribute Include primary key of entity in new relation - acts as foreign key If multi-valued attribute itself not an alternate key of entity Primary key of relation is combination of multi-valued attribute and primary key of entity Branch & Tel. No Example

Summary of how to map entities and relationships to relations

Relations for the Staff user views of DreamHome

Step 2.2 - 2.3 Step 2.2 Validate relations using normalization To validate relations in logical data model using normalization Typically already in 3NF at this point Step 2.3 Validate relations against user transactions To ensure relations in logical data model support the required transactions Same as step 1.8

Step 2.4 Check integrity constraints To check integrity constraints represented in logical data model Keep database accurate, consistent, complete Identify: Required data Attribute domain constraints Multiplicity Entity integrity Referential integrity General constraints

Step 2.4 Check integrity constraints Required data Non null attributes contain valid value Attribute domain constraints Every attribute has domain Multiplicity Constraints on relationships valid

Step 2.4 Check integrity constraints Entity integrity Primary key not null Referential integrity Foreign key must reference existing value in parent relation Foreign key null if participation optional Existence constraints General constraints

Step 2.4 Check integrity constraints Existence constraints example Insert tuple into child relation (PropertyForRent) Delete tuple from child relation (PropertyForRent) Update foreign key of child tuple (PropertyForRent) Insert tuple into parent relation (Staff) Delete tuple from parent relation (Staff) Update primary key of parent tuple (Staff)

Referential integrity constraints for relations in Staff user views of DreamHome

Step 2.5 - 2.6 Step 2.5 Review logical data model with user To review logical data model with users to ensure they consider model to be true representation of data requirements of enterprise Step 2.6 Merge logical data models into global Model (optional step) To merge logical data models into single global logical data model that represents all user views of database

Step 2.7 Step 2.7 Check for future growth To determine whether any significant changes likely in foreseeable future and if logical modal can support changes Model should be extensible

Relations for the Branch user views of DreamHome

Relations that represent the global logical data model for DreamHome

Global relation diagram for DreamHome

To Do: Chapters 16 & 17 Assignment #5 Project