Chapter 16-18 Design Methodology Pearson Education © 2009.

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

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.
1 Methodology : Conceptual Databases Design © Pearson Education Limited 1995, 2005.
Methodology Logical Database Design for the Relational Model
Lecture Fourteen Methodology - Conceptual Database Design
Methodology Conceptual Database Design
Modeling & Designing the Database
LOGICAL DATABASE DESIGN
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
Mapping ERM to relational database
CSC271 Database Systems Lecture # 21. Summary: Previous Lecture  Phases of database SDLC  Prototyping (optional)  Implementation  Data conversion.
Chapter 3 Relational Model Chapter 4 in Textbook.
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Ref. Chapter3 Lecture4 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.
Overview of the Database Development Process
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
9/14/2012ISC329 Isabelle Bichindaritz1 Database System Life Cycle.
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
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.
1/26/2004TCSS545A Isabelle Bichindaritz1 Database Management Systems Design Methodology.
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
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.
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.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences The Relational.
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.
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.
Data Modeling Using the Entity- Relationship (ER) Model
Methodology Conceptual Databases Design
Entity- Relationship (ER) Model
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 -3- Data Modeling Using the Entity-Relationship Model
CS 3630 Database Design and Implementation
Relational Database Design by ER- and EER-to-Relational Mapping
Conceptual Database Design
Chapter 4+17 The Relational Model Pearson Education © 2014.
Logical Database Design
Chapter Entity-Relationship Modeling & Enhanced Entity- Relationship Modeling.
Methodology Conceptual Databases Design
Chapter Entity-Relationship Modeling & Enhanced Entity- Relationship Modeling.
Mapping an ERD to a Relational Database
Presentation transcript:

Chapter 16-18 Design Methodology Pearson Education © 2009

Objectives The purpose of a design methodology. Database design has three main phases: conceptual, logical, and physical design. How to derive a set of relations from a conceptual data model as part of logical design.

Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the process of design. Three main phases of database design methodology: Conceptual database design Logical database design Physical database design

Database design methodology Conceptual database design: The process of constructing a model of the data used in an enterprise, independent of all physical considerations. Logical database design: The process of constructing a model of the data used in an enterprise based on a specific data model (e.g. relational), but independent of a particular DBMS and other physical considerations.

Database design methodology Physical database design: The process of producing a description of the implementation of the database on secondary storage; it describes the base relations, file organizations, and indexes design used to achieve efficient access to the data, and any associated integrity constraints and security measures.

Step 1 Build conceptual data model (Chapter 16) 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 modeling concepts (optional step) Check model for redundancy Validate conceptual model against user transactions Review conceptual data model with user

Step 2 Build and validate logical data model (Chapter 17) Derive relations for logical data model Validate relations using normalization Validate relations against user transactions Define integrity constraints Review logical data model with user Merge logical data models into global model (optional step) Check for future growth

Step 3 Translate logical data model for target DBMS (Chapter 18) Design base relations Design representation of derived data Design general constraints

Build Logical Data Model Pearson Education © 2009

Derive relations for logical data model Strong entity types For each strong entity in the data model, create a relation that includes all the simple attributes of that entity. For composite attributes, include only the constituent simple attributes(its components only). Weak entity types For each weak entity in the data model, create a relation that includes all the simple attributes of that entity. A weak entity must include its Partial key and its owner entity type PK as a FK. The combination of the two keys form the PK of the weak entity. Pearson Education © 2009

Example Employee Emp_NO{PK} Name Fname Mname Lname Gender Salary Partial Key of Week entity Dep NO Dependent Name Gender Relationship 1..1 Claims 0..* Employee (Emp_NO, Fname,Mname ,Lname,Gender, Salary) Primary Key Emp_NO DEPENDENT (DepNo, EmpNo, Name, Gender, Relationship ) Primary Key DepNo, EmpNo Pearson Education © 2009

Derive relations for logical data model One-to-many (1:*) binary relationship types For each 1:* binary relationship, the entity on the ‘one side’ of the relationship is designated as the parent entity and the entity on the ‘many side’ is designated as the child entity. To represent this relationship, post a copy of the Primary Key attribute(s) of parent entity into the relation representing the child entity, to act as a foreign key. Add attributes that describes the relationship to the child entity(if exist). Pearson Education © 2009

Example Employee Emp_NO{PK} Name Sex Salary Branch Child entity Parent entity 1..* Branch Branch_No {PK} Branch Name Allocates 0..1 Employee (Emp_NO, Name, Sex, Salary,Branch No) Primary Key Emp_NO Branch (Branch_No, Branch Name) Primary Key Branch_No Pearson Education © 2009

Derive relations for logical data model One-to-one (1:1) binary relationship types Creating relations to represent a 1:1 relationship is more complex as the cardinality cannot be used to identify the parent and child entities in a relationship. Instead, the participation constraints are used to decide whether it is best to represent the relationship by: Combining the entities involved into one relation OR by creating two relations and posting a copy of the Primary Key from one relation to the 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 Pearson Education © 2009

Derive relations for logical data model (a) Mandatory participation on both sides of 1:1 relationship Combine entities involved into one relation choose one of the primary keys of original entities to be Primary Key of the new relation, while the other (if one exists) is used as an alternate key. Add attributes that describes the relationship to the relation (if exist). Pearson Education © 2009

Example Employee SSN{PK} Name Fname Mname Lname Employee Info Emp_NO{PK} Sex Salary DOB 1..1 has 1..1 Employee (Emp_NO, SSN, Fname,Mname,Lname,Sex,Salary,DOB) Primary Key Emp_NO OR Employee (SSN , Emp_NO, Fname,Mname ,Lname, Sex, Salary,DOB) Primary Key SSN Pearson Education © 2009

Derive relations for 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 in relationship is designated as parent entity. Entity with mandatory participation is designated as child entity. A copy of Primary Key of the parent entity is placed in the relation representing the child entity. If the relationship has one or more attributes, these attributes should follow the posting of the Primary Key to the child relation. Pearson Education © 2009

Example Employee Emp_NO{PK} Name Sex Salary Branch Parent entity Child entity 1..1 Manager Branch Branch_No {PK} Branch Name Sdate Edate Manages 0..1 Employee (Emp_NO, Name, Sex, Salary) Primary Key Emp_NO Branch(Branch_No, Branch Name,_Emp_NO_Manger Sdate,Edate) Primary Key Branch_No Pearson Education © 2009

Derive relations for logical data model ( c) Optional participation on both sides of a 1:1 relationship In this case, the designation of the parent and child entities is arbitrary unless we can find out more about the relationship that can help a decision to be made one way or the other. Add attributes that describes the relationship to the child entity. Pearson Education © 2009

Example Operation Op_NO{PK} Parent entity Surgery_Material SM_No {PK} Child entity Child entity 0..1 Parent entity We have the choice to post a copy of the Primary Key of Operation entity to Surgery_Material entity or vice versa. Surgery_Material SM_No {PK} Statues Uses 0..1 Operation(Op_NO, ……) Surgery_Material(SM_No, Statues,Op_NO) Operation(Op_NO, ……, SM_No) Surgery_Material(SM_No, Statues) Pearson Education © 2009

Example Employee Emp_NO{PK} Name Sex Salary Parent entity Car Child entity 0..1 If we assume the majority of cars but not all , are used by employee and that minority of employee use cars. Therefore: - The care entity is closer to begin mandatory than employee entity. Car Car_No {PK} Statues Uses 0..1 Employee (Emp_NO, Name, Sex, Salary) Primary Key Emp_NO Car (Car_NO, Statues, Emp_NO) Primary Key Car_NO Pearson Education © 2009

Derive relations for logical data model Recursive relationships Mapping conclusion One-to-many (1:*) recursive relationships Single relation with two copies for the primary key with different names. Many-to-many (*:*) recursive relationships Two relations One relation for the entity type. And create a new relation to represent the relationship. The new relation would only have two attributes, both copies of the primary key(i.e. the primary key has two attributes, both taken from the primary key of the entity). Pearson Education © 2009

One-to-many (1:*) recursive relationships Example a) One-to-many (1:*) recursive relationships The representation of a 1:* recursive relationship is similar to 1:* binary relationship. However, in this case, both the parent and child entity is the same entity. Is_managed_by Staff 0..* Employee Employee_I{PK} Employee_Name Employee_DOB Manager 0..1 EMPLOYEE (Employee_ID, Employee_Name, Employee_DOB, Manager_ID) Primary Key Employee ID Foreign Key Manager_ID 23 Pearson Education © 2009

Many-to-many (*:*) recursive relationships Example b) Many-to-many (*:*) recursive relationships Contains  Component Quantity 0..* Item Item No{PK} Description Unit_Cost Product 0..* ITEM (Item_No, Description, Unit_Cost) Primary Key: Item_No COMPONENT (Item_No, Componenet_No, Quantity) Primary Key: Item_No, Componenet_No Foreign Key: Item_No references ITEM(Item_No) Foreign Key: Componenet_No references ITEM(Item_No) 24 Pearson Education © 2009

Derive relations for logical data model Superclass/subclass relationship types Identify superclass entity as parent entity and subclass entity as the child entity. There are various options on how to represent such a relationship as one or more relations. The selection of the most appropriate option is dependent on a number of factors: The disjointness and participation constraints on the superclass/subclass relationship whether the subclasses are involved in distinct relationships The number of participants in the superclass/subclass relationship. Pearson Education © 2009

Guidelines for representation of superclass / subclass relationship Pearson Education © 2009

Representation of superclass / subclass relationship based on participation and disjointness Pearson Education © 2009

Representation of superclass / subclass relationship based on participation and disjointness Pearson Education © 2009

Representation of superclass / subclass relationship based on participation and disjointness Pearson Education © 2009

Representation of superclass / subclass relationship based on participation and disjointness Pearson Education © 2009

Derive relations for logical data model Many-to-many (*:*) binary relationship types Create a relation to represent the relationship and include any attributes that are part of the relationship. We post a copy of the Primary Key attribute(s) of the entities that participate in the relationship into the new relation, to act as foreign keys. These foreign keys will also form the Primary Key of the new relation, possibly in combination with some of the attributes of the relationship. Pearson Education © 2009

Example Employee Emp_NO{PK} Name Sex Salary Project Proj_No {PK} Hours 1..* Project Proj_No {PK} Project Name Hours Works on 0..* Employee (Emp_NO, Name, Sex, Salary) Primary Key Emp_NO Project (Proj_No, ProjectName) Primary Key Proj_No Work-on(EmpNo,ProjNo, hours) Primary Key Emp_NO Proj_No, Pearson Education © 2009

Derive relations for logical data model Complex relationship types Create a relation to represent the relationship and include any attributes that are part of the relationship. Post a copy of the Primary Key attribute(s) of the entities that participate in the complex relationship into the 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 this new relation, possibly in combination with some of the attributes of the relationship. Pearson Education © 2009

Example Sdate Edate Supplier Business SupNo {PK} BizNo {PK} Lawyer Contracts Lawyer LawNo, {PK} Business (BizNo., ……) Supplier(SupNo, ……..) Lawyer(LawNo,…….…) Contract(BizNo, SupNo, LawNo, StDate, EDate) Pearson Education © 2009

Derive relations for logical data model Multi-valued attributes Create a 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, the Primary Key of the new relation is the combination of the multi-valued attribute and the Primary Key of the entity. Pearson Education © 2009

Example The Primary Key of new relation: - the multi-valued attribute if itself an alternate key. ( e.g. we sure that there are no duplicated tel_nos for employees ). -OR the combination of the multi-valued attribute and the Primary Key of the entity. ( e.g. 2 brothers work in same company). Employee Emp_NO{PK} Name Sex Salary Tel_no [1..*] Employee (Emp_NO, Name, Sex, Salary) Primary Key Emp_NO Telephone(Tel_no, EmpNo) Primary Key Tel_no OR Primary Key Tel_no, EmpNo Pearson Education © 2009

Summary of how to map entities and relationships to relations Pearson Education © 2009