Logical Database Design

Slides:



Advertisements
Similar presentations
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.
Advertisements

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.
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.
Database Systems: A Practical Approach to Design, Implementation and Management International Computer Science S. Carolyn Begg, Thomas Connolly Lecture.
Methodology Conceptual Database Design
Modeling & Designing the Database
LOGICAL DATABASE DESIGN
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
Chapter 3 Relational Model Chapter 4 in Textbook.
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Ref. Chapter3 Lecture4 1.
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Chapter 16 Methodology - Conceptual Database Design.
Methodology - Conceptual Database Design Transparencies
Software School of Hunan University Database Systems Design Part III Section 5 Design Methodology.
Methodology Conceptual Databases Design
Chapter 5 Entity–Relationship Modeling
CSCI 3140 Module 2 – Conceptual Database Design Theodore Chiasson Dalhousie University.
Entity Relationship Modeling
1 Chapter 15 Methodology Conceptual Databases Design Transparencies Last Updated: April 2011 By M. Arief
9/10/2012ISC 329 Isabelle Bichindaritz1 Entity Relationship (E-R) Modeling.
9/19/2012ISC329 Isabelle Bichindaritz1 Conceptual Data Modeling.
10/3/2012ISC329 Isabelle Bichindaritz1 Logical Design.
CSC271 Database Systems Lecture # 29. Summary: Previous Lecture  The normalization process  1NF, 2NF, 3NF  Inference rules for FDs  BCNF.
Methodology - Conceptual Database Design. 2 Design Methodology u Structured approach that uses procedures, techniques, tools, and documentation aids to.
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
© Pearson Education Limited, Chapter 9 Logical database design – Step 1 Transparencies.
Conceptual Database Design
Chapters 15 &16 Conceptual and Logical Database Design Methodology.
Chapter 8 Methodology - Conceptual Database Design Chapter 15 in Textbook.
Methodology - Conceptual Database Design
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
1 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.
Part4 Methodology of Database Design Chapter 07- Overview of Conceptual Database Design Lu Wei College of Software and Microelectronics Northwestern Polytechnical.
1 Chapter 17 Methodology - Local Logical Database Design.
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
Database Design – Lecture 4 Conceptual Data Modeling.
Chapter 17 Logical Database Design for the Relational Model Pearson Education © 2009.
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.
Chapter 15 & 16 Conceptual and Logical Database Design Methodology Thomas Connolly, Carolyn Begg, Database System, A Practical Approach to Design Implementation.
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Prepared by L. Nouf Almujally Ref. Chapter3 Lecture4 1.
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.
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
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.
Logical Database Design
Methodology Conceptual Databases Design
Methodology - Global Logical Database Design
Presentation transcript:

Logical Database Design Lecture Fifteen Methodology - Logical Database Design Based on Chapter Fifteen of this book: Database Systems: A Practical Approach to Design, Implementation and Management International Computer Science S.  Carolyn Begg, Thomas Connolly

Lecture 15 - Objectives How to remove features from a local conceptual model that are not compatible with the relational model. How to derive a set of relations from a local logical data model. How to validate these relations using the technique of normalization.

Lecture 15 - Objectives How to validate a logical data model to ensure it supports required user transactions. How to merge local logical data models based on specific views into a global logical data model of the enterprise. How to ensure that resultant global model is a true and accurate representation of enterprise.

Methodology Overview - Logical Database Design for Relational Model Step 2 Build and validate local logical data model for each view Step 2.1 Remove features not compatible with the relational model (optional step) Step 2.2 Derive relations for local logical data model Step 2.3 Validate relations using normalization Step 2.4 Validate relations against user transactions Step 2.5 Define integrity constraints Step 2.6 Review local logical data model with user

Step 2 Build and Validate Local Logical Data Model To build a local logical data model from a local conceptual data model representing a particular view of the enterprise, and then to validate this model to ensure it is structurally correct (using the technique of normalization) and to ensure it supports the required transactions.

Local conceptual data model for Staff view showing all attributes

Step 2 Build and Validate Local Logical Data Model Step 2.1 Remove features not compatible with the relational model (optional step – if omitted then step 2.2 will be more complex) To refine the local conceptual data model to remove features that are not compatible with the relational model. This involves: remove *:* binary relationship types; remove *:* recursive relationship types; remove complex relationship types; remove multi-valued attributes.

Remove *:* binary relationship types

Remove *:* recursive relationship types

Remove complex relationship types

Remove multi-valued attributes

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

Step 2.2 Derive relations for local logical data model (1) Strong entity types Create a relation that includes all simple attributes of that entity. For composite attributes, include only constituent simple attributes. Staff (staffNo, fName, lName, position, sex, DOB) Primary Key staffNo

Step 2.2 Derive relations for local logical data model (2) Weak entity types Create a relation that includes all simple attributes of that entity. Primary key is partially or fully derived from each owner entity. Preference (prefType, maxRent) Primary Key None (at present)

Step 2.2 Derive relations for local logical data model (3) 1:* binary relationship types Entity on ‘one side’ is designated the parent entity and entity on ‘many side’ is the child entity. Post copy of the primary key attribute(s) of parent entity into relation representing child entity, to act as a foreign key.

Step 2.2 Derive relations for local logical data model (4) 1:1 binary relationship types More complex as cardinality cannot be used to identify parent and child entities in a relationship. Instead, participation used to decide whether to combine entities into one relation or to create two relations and post copy of primary key from one relation to the other. Consider 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.2 Derive relations for local logical data model (a) Mandatory participation on both sides of 1:1 relationship Combine entities involved into one relation and choose one of the primary keys of original entities to be primary key of new relation, while other (if one exists) is used as an alternate key. Client (clientNo, fName, lName, telNo, prefType, maxRent, staffNo) Primary Key clientNo Foreign Key staffNo references Staff(staffNo)

Step 2.2 Derive relations for local logical data model (b) Mandatory participation on one side of a 1:1 relationship Identify parent and child entities using participation constraints. Entity with optional participation is designated parent entity, and other entity designated child entity. Copy of primary key of parent placed in relation representing child entity. If relationship has one or more attributes, these attributes should follow the posting of the primary key to the child relation.

Step 2.2 Derive relations for local logical data model (b) Mandatory participation on one side of a 1:1 relationship - Example

Step 2.2 Derive relations for local logical data model (c) Optional participation on both sides of a 1:1 relationship Designation of the parent and child entities is arbitrary unless can find out more about the relationship. Consider 1:1 Staff Uses Car relationship with optional participation on both sides. Assume majority of cars, but not all, are used by staff and only minority of staff use cars. Car entity, although optional, is closer to being mandatory than Staff entity. Therefore designate Staff as parent entity and Car as child entity.

Step 2.2 Derive relations for local logical data model (5) 1:1 recursive relationships - follow rules for participation for a 1:1 relationship. mandatory participation on both sides: single relation with two copies of the primary key. mandatory participation on only one side: option to create a single relation with two copies of the primary key, or create a new relation to represent the relationship. The new relation would only have two attributes, both copies of the primary key. optional participation on both sides, again create a new relation as described above.

Step 2.2 Derive relations for local logical data model (6) Superclass/subclass relationship types Identify superclass as parent entity and subclass entity as child entity. There are various options on how to represent such a relationship as one or more relations. Most appropriate option dependent on number of factors such as: disjointness and participation constraints on the superclass/subclass relationship, whether subclasses are involved in distinct relationships, number of participants in superclass/subclass relationship.

Guidelines for representation of superclass / subclass relationship

Summary of how to map entities and relationships to relations

Relations for the Staff view of DreamHome

Step 2 Build and Validate Local Logical Data Model Step 2.3 Validate relations using normalization To validate the relations in the local logical data model using the technique of normalization. Step 2.4 Validate relations against user transactions To ensure that the relations in the local logical data model support the transactions required by the view. Step 2.5 Define integrity constraints To define the integrity constraints given in the view (ie. required data, entity and referential integrity, domains, and enterprise constraints).

Referential integrity constraints for relations in Staff view of DreamHome

Step 2 Build and Validate Local Logical Data Model Step 2.6 Review local logical data model with user To ensure that the local logical data model and supporting documentation that describes the model is a true representation of the view.

Methodology Overview - Logical Database Design for Relational Model Step 3 Build and validate global logical data model Step 3.1 Merge local logical data models into global model Step 3.2 Validate global logical data model Step 3.3 Check for future growth Step 3.4 Review global logical data model with users

Step 3 Build and Validate Global Logical Data Model To combine the individual local logical data models into a single global logical data model that represents the enterprise. Step 3.1 Merge local logical data models into global model To merge the individual local logical data models into a single global logical data model of the enterprise.

Methodology Overview - Logical Database Design for Relational Model Step 3 Build and validate global logical data model Step 3.1 Merge local logical data models into global model Step 3.2 Validate global logical data model Step 3.3 Check for future growth Step 3.4 Review global logical data model with users

Relations for the Staff view of DreamHome

Relations for the Branch view of DreamHome

Step 3 Build and Validate Global Logical Data Model Typically includes: (1) Review the names and contents of entities/relations and their candidate keys. (2) Review the names and contents of relationships/foreign keys. (3) Merge entities/relations from the local data models (4) Include (without merging) entities/relations unique to each local data model (5) Merge relationships/foreign keys from the local data models.

Step 3 Build and Validate Global Logical Data Model (6) Include (without merging) relationships/foreign keys unique to each local data model. (7) Check for missing entities/relations and relationships/foreign keys. (8) Check foreign keys. (9) Check Integrity Constraints. (10) Draw the global ER/relation diagram (11) Update the documentation.

Step 3 Build and Validate Global Logical Data Model

Step 3 Build and Validate Global Logical Data Model

Relations that represent the global logical data model for DreamHome

Global relation diagram for DreamHome

Step 3 Build and Validate Global Logical Data Model Step 3.2 Validate global logical data model To validate the relations created from the global logical data model using the technique of normalization and to ensure they support the required transactions, if necessary. Step 3.3 Check for future growth To determine whether there are any significant changes likely in the foreseeable future and to assess whether the global logical data model can accommodate these changes.

Step 3 Build and Validate Global Logical Data Model Step 3.4 Review global logical data model with users To ensure that the global logical data model is a true representation of the enterprise.