1 Chapter 17 Methodology - Local Logical Database Design.

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
Assignment Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the.
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.
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
1 Methodology : Conceptual Databases Design © Pearson Education Limited 1995, 2005.
Methodology Logical Database Design for the Relational Model
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Modeling & Designing the Database
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
ER- and EER-to-Relational Mapping
Chapter 3 Relational Model Chapter 4 in Textbook.
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Ref. Chapter3 Lecture4 1.
Chapters 17 & 18 Physical Database Design Methodology.
Web-Enabled Decision Support Systems
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
CSCI 3140 Module 2 – Conceptual Database Design Theodore Chiasson Dalhousie University.
1 Chapter 15 Methodology Conceptual Databases Design Transparencies Last Updated: April 2011 By M. Arief
10/3/2012ISC329 Isabelle Bichindaritz1 Logical Design.
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.
DATABASE MGMT SYSTEM (BCS 1423) Chapter 5: Methodology – Conceptual Database Design.
Team Dosen UMN Database Design Connolly Book Chapter
B. Information Technology (Hons.) CMPB245: Database Design Logical Database Design.
© Pearson Education Limited, Chapter 9 Logical database design – Step 1 Transparencies.
Chapters 15 &16 Conceptual and Logical Database Design Methodology.
Chapter 8 Methodology - Conceptual Database Design Chapter 15 in Textbook.
Methodology - Conceptual Database Design
1 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.
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.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Part4 Methodology of Database Design Chapter 07- Overview of Conceptual Database Design Lu Wei College of Software and Microelectronics Northwestern Polytechnical.
Mapping from conceptual model (EER-M)
Logical Design database design. Dr. Mohamed Osman Hegaz2 Conceptual Database Designing –Provides concepts that are close to the way many users perceive.
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.
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.
Mapping ER to Relational Model Each strong entity set becomes a table. Each weak entity set also becomes a table by adding primary key of owner entity.
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
Chapter 5 Database Design
Methodology Logical Database Design for the Relational Model
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.
CS 3630 Database Design and Implementation
Conceptual Database Design
Chapter 4+17 The Relational Model Pearson Education © 2014.
Logical Database Design
Methodology Conceptual Databases Design
Presentation transcript:

1 Chapter 17 Methodology - Local Logical Database Design

2 Local conceptual data model for Staff view showing all attributes

3 Step 2 Build and Validate Local Logical Data Model Step 2.1 Remove features not compatible with the relational model (optional step) u 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.

4 Remove *:* binary relationship types

5 Remove *:* recursive relationship types

6 Remove complex relationship types

7 Remove multi-valued attributes

8 Step 2 Build and Validate Local Logical Data Model u 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.

9 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

10 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)

11 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.

12 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.

13 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)

14 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.

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

16 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. u 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. u Car entity, although optional, is closer to being mandatory than Staff entity. Therefore designate Staff as parent entity and Car as child entity.

17 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.

18 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.

19 Guidelines for representation of superclass / subclass relationship

20 Step 2.2 Derive relations for local logical data model (7) *:* binary relationship types –Create relation to represent relationship and include any attributes that are part of relationship. –Post a copy of the primary key attribute(s) of the entities that participate in relationship into new relation, to act as foreign keys. –These foreign keys will also form primary key of new relation, possibly in combination with some of the attributes of the relationship.

21 Step 2.2 Derive relations for local logical data model (7) *:* binary relationship types - Example

22 Step 2.2 Derive relations for local logical data model (8) Complex relationship types –Create relation to represent relationship and include any attributes that are part of the relationship. –Post copy of primary key attribute(s) of entities that participate in the complex relationship into new relation, to act as foreign keys. –Any foreign keys that represent a ‘many’ relationship (for example, 1..*, 0..*) generally will also form the primary key of new relation, possibly in combination with some of the attributes of the relationship.

23 Step 2.2 Derive relations for local logical data model (8) Complex relationship types - Example

24 Step 2.2 Derive relations for local logical data model (9) Multi-valued attributes –Create new relation to represent multi-valued attribute and include primary key of entity in new relation, to act as a foreign key. –Unless the multi-valued attribute is itself an alternate key of the entity, primary key of new relation is combination of the multi-valued attribute and the primary key of the entity.

25 Step 2.2 Derive relations for local logical data model (9) Multi-valued attributes - Example

26 Summary of how to map entities and relationships to relations

27 Relations for the Staff view of DreamHome

28 Step 2 Build and Validate Local Logical Data Model u Step 2.3 Validate relations using normalization –To validate the relations in the local logical data model using the technique of normalization. u 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. u Step 2.5 Define integrity constraints –To define the integrity constraints given in the view (ie. required data, entity and referential integrity (strategies), domains, and enterprise constraints).

29 Referential Integrity u Case 1: Insert tuple into child relation u Case 2: Delete tuple from Child relation u Case 3: Update foreign key of child tuple u Case 4: Insert tuple into Parent relation u Case 5: Delete tuple from parent relation –No Action –Cascade –Set Null –Set Default –No Check u Case 6: Update primary key of parent tuple –Cascade

30 Referential integrity constraints for relations in Staff view of DreamHome

31 Step 2 Build and Validate Local Logical Data Model u 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.