Database Design Methodologies



Similar documents
Bridge from Entity Relationship modeling to creating SQL databases, tables, & relations

7.1 The Information system

Database Design Methodology

Relational Schema Design

Database Concepts. Database & Database Management System. Application examples. Application examples

Normalization. Purpose of normalization Data redundancy Update anomalies Functional dependency Process of normalization

DATABASE NORMALIZATION

Normalization. Normalization. Normalization. Data Redundancy

Database Design Methodology

Lecture 2 Normalization

A. TRUE-FALSE: GROUP 2 PRACTICE EXAMPLES FOR THE REVIEW QUIZ:

Physical Design. Meeting the needs of the users is the gold standard against which we measure our success in creating a database.

How To Write A Diagram

CS 377 Database Systems. Database Design Theory and Normalization. Li Xiong Department of Mathematics and Computer Science Emory University

Fundamentals of Database Design

Databases What the Specification Says

THE ENTITY- RELATIONSHIP (ER) MODEL CHAPTER 7 (6/E) CHAPTER 3 (5/E)

Designing a Database Schema

2. Conceptual Modeling using the Entity-Relationship Model

Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model

DATABASE DESIGN: NORMALIZATION NOTE & EXERCISES (Up to 3NF)

Introduction to normalization. Introduction to normalization

Overview. Physical Database Design. Modern Database Management McFadden/Hoffer Chapter 7. Database Management Systems Ramakrishnan Chapter 16

Database IST400/600. Jian Qin. A collection of data? A computer system? Everything you collected for your group project?

DATABASE DESIGN. - Developing database and information systems is performed using a development lifecycle, which consists of a series of steps.

Normalization in Database Design

Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases

Chapter 5: Logical Database Design and the Relational Model Part 2: Normalization. Introduction to Normalization. Normal Forms.

Modern Systems Analysis and Design

Fundamentals of Database System

Physical Database Design and Tuning

IT2304: Database Systems 1 (DBS 1)

Concepts of Database Management Seventh Edition. Chapter 6 Database Design 2: Design Method

IT2305 Database Systems I (Compulsory)

1. Physical Database Design in Relational Databases (1)

Data Analysis 1. SET08104 Database Systems. Napier University

DATABASE SYSTEMS. Chapter 7 Normalisation

not necessarily strictly sequential feedback loops exist, i.e. may need to revisit earlier stages during a later stage

Unit 2.1. Data Analysis 1 - V Data Analysis 1. Dr Gordon Russell, Napier University

TIM 50 - Business Information Systems

Distributed Databases. Concepts. Why distributed databases? Distributed Databases Basic Concepts

The Entity-Relationship Model

MCQs~Databases~Relational Model and Normalization

The Entity-Relationship Model

The Relational Model. Why Study the Relational Model? Relational Database: Definitions

CSC 742 Database Management Systems

Conceptual Design Using the Entity-Relationship (ER) Model

Chapter 10 Practical Database Design Methodology and Use of UML Diagrams

Database Design. Marta Jakubowska-Sobczak IT/ADC based on slides prepared by Paula Figueiredo, IT/DB

Database Design Overview. Conceptual Design ER Model. Entities and Entity Sets. Entity Set Representation. Keys

Chapter 10 Functional Dependencies and Normalization for Relational Databases

Information Systems Analysis and Design CSC John Mylopoulos Database Design Information Systems Analysis and Design CSC340

A brief overview of developing a conceptual data model as the first step in creating a relational database.

DBMS. Normalization. Module Title?

Outline. Data Modeling. Conceptual Design. ER Model Basics: Entities. ER Model Basics: Relationships. Ternary Relationships. Yanlei Diao UMass Amherst

Introduction. to Database LEARNING OUTCOMES TABLE OF CONTENTS

Entity-Relationship Model

Lecture Notes INFORMATION RESOURCES

Chapter 6. Database Tables & Normalization. The Need for Normalization. Database Tables & Normalization

Announcements. SQL is hot! Facebook. Goal. Database Design Process. IT420: Database Management and Organization. Normalization (Chapter 3)

Normalization of Database

COMHAIRLE NÁISIÚNTA NA NATIONAL COUNCIL FOR VOCATIONAL AWARDS PILOT. Consultative Draft Module Descriptor. Relational Database

BCA. Database Management System

DATABASE MANAGEMENT SYSTEMS. Question Bank:

Entity/Relationship Modelling. Database Systems Lecture 4 Natasha Alechina

CSC 443 Data Base Management Systems. Basic SQL

ER & EER to Relational Mapping. Chapter 9 1

2. Basic Relational Data Model

Chapter 3. Data Modeling Using the Entity-Relationship (ER) Model

Theory of Relational Database Design and Normalization

Functional Dependency and Normalization for Relational Databases

Normalization. Reduces the liklihood of anomolies

A Tool for Generating Relational Database Schema from EER Diagram

Database Design. Database Design I: The Entity-Relationship Model. Entity Type (con t) Chapter 4. Entity: an object that is involved in the enterprise

XV. The Entity-Relationship Model

Foundations of Business Intelligence: Databases and Information Management

Chapter 2: Entity-Relationship Model. Entity Sets. " Example: specific person, company, event, plant

LiTH, Tekniska högskolan vid Linköpings universitet 1(7) IDA, Institutionen för datavetenskap Juha Takkinen

IV. The (Extended) Entity-Relationship Model

Requirement Analysis & Conceptual Database Design. Problem analysis Entity Relationship notation Integrity constraints Generalization

The Relational Model. Why Study the Relational Model? Relational Database: Definitions. Chapter 3

Data Modeling: Part 1. Entity Relationship (ER) Model

Chapter 10. Functional Dependencies and Normalization for Relational Databases. Copyright 2007 Ramez Elmasri and Shamkant B.

Database Design--from E-R Diagram to SQL Statement

Rose Data Modeler (logical)

Schema Design and Normal Forms Sid Name Level Rating Wage Hours

SQL Server. 1. What is RDBMS?

SAMPLE FINAL EXAMINATION SPRING SESSION 2015

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. The Relational Model. The relational model

CIS 631 Database Management Systems Sample Final Exam

Introduction to Computing. Lectured by: Dr. Pham Tran Vu

Entity - Relationship Modelling

The Entity-Relationship Model

CHAPTER 6 DATABASE MANAGEMENT SYSTEMS. Learning Objectives

Review: Participation Constraints

CSCI-GA Database Systems Lecture 7: Schema Refinement and Normalization

CSE 233. Database System Overview

CS143 Notes: Normalization Theory

COURSE NAME: Database Management. TOPIC: Database Design LECTURE 3. The Database System Life Cycle (DBLC) The database life cycle contains six phases;

Transcription:

Critical Success Factors in Database Design Database Design Methodologies o Work interactively with the users as much as possible. o Follow a structured methodology throughout the data modeling process. o Employ a data-driven approach. o Incorporate structural and integrity considerations into the data models. o Combine conceptualization, normalization, and transaction validation techniques into the data modeling methodology. Database Design Methodology - 1 Database Design Methodology - 2 Critical Success Factors in Database Design o Use diagrams to represent as much of the data models as possible. o Good documentation of additional data semantics. o Build a data dictionary to supplement the data model diagrams. o Be willing to repeat steps. Database Design Methodology - 3 Database Design Methodology 3 main phases: o Conceptual database design Construct a model of the information used, independent of all physical considerations. o Logical database design Construct a model of the information used, based on a specific data model (e.g. relational), but independent of a particular DBMS and other physical considerations. o Physical database design Produce a description of the implementation of the DB on secondary storage; it describes the storage structures and access methods used to achieve efficient access to the data. Database Design Methodology - 4

Methodology Overview Step 1 Build local conceptual data model for each user view Step 2 Build and Validate Local Logical Data Model Step 3 Step 4 Step 5 Step 6 Step 7 Build and Validate Global Logical Data Model Translate Global Logical Data Model for Target DBMS Design Physical Representation Design and Implement Security Mechanisms Monitor and Tune the Operational System Database Design Methodology - 5 Methodology Overview - Conceptual Database Design Step 1 Build local conceptual data model for each user view Step 1.1 Identify entity types Step 1.2 Identify relationship types Step 1.3 Identify and associate attributes with entity or relationship types Step 1.4 Determine attribute domains Step 1.5 Determine candidate and primary key attributes Step 1.6 Specialize/generalize entity types (optional step) Step 1.7 Draw Entity Relationship diagram Step 1.8 Review Local Conceptual Data Model with User Database Design Methodology - 6 Methodology Overview Logical Database Design for Relational Model Step 2 Build and Validate Local Logical Data Model Step 2.1 Map Local Conceptual Data Model to Local Logical Data Model Step 2.2 Derive Relations from Local Logical Data Model Step 2.3 Validate Model using Normalization Step 2.4 Validate Model against User Transactions Step 2.5 Draw Entity-Relationship Diagram Step 2.6 Define Integrity Constraints Step 2.7 Review Local Logical Data Model with User 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 Draw Final Entity-Relationship Diagram Step 3.5 Review Global Logical Data Model with Users Database Design Methodology - 7 Database Design Methodology - 8

Methodology Overview Physical Database Design for Relational Databases Step 4 Translate Global Logical Data Model for Target DBMS Step 4.1 Design Base Relations for Target DBMS Step 4.2 Design Integrity Rules for Target DBMS Methodology Overview Physical Database Design for Relational Databases Step 6 Design and Implement Security Mechanisms Step 6.1 Design User Views Step 6.2 Design Access Rules Step 5 Design Physical Representation Step 5.1 Analyze Transactions Step 5.2 Choose File Organization Step 5.3 Choose Secondary Indexes Step 5.4 Consider the Introduction of Controlled Redundancy Step 7 Monitor and Tune the Operational System Step 5.5 Estimate Disk Space Database Design Methodology - 9 Database Design Methodology - 10 Step 1.1 Identify entity types Step 1.2 Identify relationship types Branch Staff Supervisor Secretary Property_for_Rent Private_Owner Business_Owner Advert Newspaper Interview Client Lease_Agreement Inspection Database Design Methodology - 11 Database Design Methodology - 12

Step 1.2 Identify relationship types o Branch Has Staff Relationship Step 1.2 Identify relationship types o Property_for_Rent DescribedIn Advert relationship o Staff Manages Property_for_Rent relationship o Client Views Property_for_Rent relationship Database Design Methodology - 13 Database Design Methodology - 14 Step 1.3 Identify and associate attributes with entity or relationship types Sketch of Supervisor's Local Conceptual Data Model Database Design Methodology - 15 Database Design Methodology - 16

Step 1.3 Identify and associate attributes with entity or relationship types Step 1.4 Determine attribute domains o For attributes in the Supervisor s local conceptual data model of the DreamHome company. (e.g. Domain of Branch_No attribute of Branch entity includes a three-character string, with values ranging from B1 to B99). Database Design Methodology - 17 Database Design Methodology - 18 Step 1.5 Determine candidate and primary key attributes Step 1.6 Specialize / Generalize Entity Types (Optional Step) Database Design Methodology - 19 Database Design Methodology - 20

Step 1.6 Specialize / Generalize Entity Types (Optional Step) Step 1.6 Specialize / Generalize Entity Types (Optional Step) Additional Example Additional Example Database Design Methodology - 21 Database Design Methodology - 22 Step 2.1 Map Local Conceptual Data Model to Local Logical Data Model Step 1.7 Draw Supervisor's Local Conceptual Data Model To refine the local conceptual data model to remove undesirable features and to map this model to a local logical data model: (a) Remove M:N relationships. (b) Remove complex relationships. (c) Remove recursive relationships. (d) Remove relationships with attributes. (e) Remove multi-valued attributes. (f) Re-examine 1:1 relationships. (g) Remove redundant relationships. Removing data structures that are difficult to implement in relational databases. Database Design Methodology - 23 Database Design Methodology - 24

Removing Advertises M:N Relationship Removing Leases Complex Relationship Database Design Methodology - 25 Database Design Methodology - 26 Removing Supervises Recursive Relationship Removing WorksAt Relationship with Hours_Worked Attribute Database Design Methodology - 27 Database Design Methodology - 28

Removing Tel_No Multi-valued Attribute Non-Redundant Relationships A relationship is redundant if the same information can be obtained from other relationships. Database Design Methodology - 29 Database Design Methodology - 30 An Example Logical Data Model Supervisor's local logical data model (Version 1) Database Design Methodology - 31 Database Design Methodology - 32

Step 2.2 Derive Relations From Local Logical Data Model Step 2.2 Derive Relations From Local Logical Data Model o Strong Entity Types: create a relation that includes all simple attributes. Eg. Staff(Staff_No, FName, LName, Street, City, Postcode, Position, Sex, Salary) o Week Entity Types: create a relation that includes all simple attributes. In addition, include as a foreign key the primary key of the owner entity. o 1:1 Relationship Types: post a copy of the primary key attribute(s) of entity E1 into the E2 relation, to act as a foreign key. (The indentification of E1 and E2 depends on the participation constraints) Eg. - Staff(Staff_No, Fname, Lname,..) - Branch (Branch_No, Address,.., Manager_No), Foreign Key Manager_No references Staff(Staff_No) Eg. Next-of-Kin (Staff_No, NName, Address, Tel_No, Relationship), Foreign key Staff_No references Staff(Staff_No) Database Design Methodology - 33 Database Design Methodology - 34 Step 2.2 Derive Relations From Local Logical Data Model o 1:M Relationship Types of E1 to E2: post a copy of the primary key attribute(s) of entity E1 into the E2 relation, to act as a foreign key. Eg. Branch (Branch_No, Address,..) Staff (Staff_No, Fname,.. Branch_No), Foreign Key Branch_No references Branch (Branch_No) Database Design Methodology - 35 Step 2.2 Derive Relations From Local Logical Data Model o Superclass/subclass relationships: Example 1: All_Property(Property_No, Address, Type, Rent, Price) Example 2: Property_For_Rent(Property_No, Address, Type, Rent) Property_For_Sale(Property_No, Address, Type, Price) Example 3: Property(Property_No, Address, Type) Property_For_Rent(Property_No, Rent), Foreign Key Property_No references Property(Property_No) Property_For_Sale(Property_No, Price), Foreign Key Property_No references Property(Property_No) Database Design Methodology - 36

Step 2.3 Validate Model using Normalization To ensure that each relation derived from the logical data model is in at least Boyce-Codd Nornal Form. Issues: o A normalized design organizes the data according to its functional dependencies => lies somewhere between conceptual and physical design o The logical design may not be the final design. Eg. some normalized relations are denormalized in the physical design. o Normalization forces us to understand completely each attribute. o A normalized design is free of update anomalies, and the DB can be easily extended. Database Design Methodology - 37 Step 2.4 Validate Model Against User Transactions To ensure that the logical data model supports the transactions that are required by the user view. Example transactions (a) Insert details for new members of staff. (b) Delete details of a member of staff, given the staff number. Database Design Methodology - 38 Supervisor's local logical data model displaying the transactions supported Step 2.5 Draw Supervisor's local logical data model (Final Version) Database Design Methodology - 39 Database Design Methodology - 40

Step 3.1 Merge Local Logical Data Models into Global Models Comparison of entities and their primary keys in Supervisor s and Manager s views (a) Review the names of entities and their primary keys. (b) Review the names of relationships. (c) Merge entities from the local views. (d) Include (without merging) entities unique to each local view. (e) Merge relationships from the local views. (f) Include (without merging) relationships unique to each local view. (g) Check for missing entities and relationships. (h) Check foreign keys. (i) Check Integrity Constraints. (j) Draw the global logical data model. (k) Update the documentation. Database Design Methodology - 41 Database Design Methodology - 42 Comparison of relationships in Supervisor s and Manager s views Merging the Staff entities from Supervisor's and Manager's views Database Design Methodology - 43 Database Design Methodology - 44

Merging the Advert entities from Supervisor's and Manager's views Step 3.1 Merge Local Logical Data Models into Global Models Database Design Methodology - 45 Database Design Methodology - 46 Step 3.4 Draw Global logical data model of DreamHome case study Physical Database Design (Steps 4-7) o Sources of information for the physical design process includes global logical data model and documentation that describes model. o Logical database design is concerned with the what, physical database design is concerned with the how. o Physical Database Design is the process of producing a description of the implementation of the database on secondary storage. o Describes the storage structures and access methods used to achieve efficient access to the data. Database Design Methodology - 47 Database Design Methodology - 48

Step 4 Translate Global Logical Data Model for Target DBMS Step 5 Design Physical Representation o Typical Disk Configuration Database Design Methodology - 49 Database Design Methodology - 50 Step 5.1 Analyze transactions ER Model for Sample Transactions showing Expected Occurrences Example - Sample Transactions (A) (B) (C) (D) Insert details for a new member of staff, given the branch address. List rental properties handled by each staff member at a given branch address. Assign a rental property to a member of staff, checking that a staff member does not manage more than 10 properties already. List rental properties handled by each branch office. Database Design Methodology - 51 Database Design Methodology - 52

Transaction Usage Map for Sample Transactions Analysis of Selected Transaction A Database Design Methodology - 53 Database Design Methodology - 54 Analysis of Selected Transaction B Analysis of Selected Transaction C Database Design Methodology - 55 Database Design Methodology - 56

Step 5.4 Consider introducing controlled redundancy Step 5.4 Consider introducing controlled redundancy Example 1: Example 2: Combined renter and interview relations Database Design Methodology - 57 Database Design Methodology - 58 Step 5.4 Consider introducing controlled redundancy Step 5.5 Estimate disk space requirements Example 2: Duplicating LName attribute in the Property_for_Rent relation o Lookup Table for Property_Type Attribute Database Design Methodology - 59 Database Design Methodology - 60

Step 5.5 Estimate disk space requirements o Comparison of Space Requirements for Property_for_Rent Relation Database Design Methodology - 61