Designing Databases Modern Systems Analysis and Design Fifth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.

Slides:



Advertisements
Similar presentations
© 2005 by Prentice Hall 1 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B.
Advertisements

Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
© 2005 by Prentice Hall Chapter 3a Database Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Data Storage Formats Files Databases
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Modern Systems Analysis and Design Third Edition
Chapter 9 Designing Databases
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Chapter 8 Structuring System Data Requirements
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
10-1 Chapter 10 Designing Databases Modern Systems Analysis and Design Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 Part 2: File Organization and Performance Modern Database Management 10 th Edition.
Chapter 6 Physical Database Design. Introduction The purpose of physical database design is to translate the logical description of data into the technical.
1 C omputer information systems Design Instructor: Mr. Ahmed Al Astal IGGC1202 College Requirement University Of Palestine.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
1 © Prentice Hall, 2002 Physical Database Design Dr. Bijoy Bordoloi.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 2 Slide 1 Chapter 10 Designing Databases.
Chapter 9 Designing Databases Modern Systems Analysis and Design Sixth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Concepts and Terminology Introduction to Database.
Lecture 12 Designing Databases 12.1 COSC4406: Software Engineering.
10/3/2012ISC329 Isabelle Bichindaritz1 Logical Design.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Chapter 6 1 © Prentice Hall, 2002 The Physical Design Stage of SDLC (figures 2.4, 2.5 revisited) Project Identification and Selection Project Initiation.
Chapter 10 Designing Databases Modern Systems Analysis and Design Fifth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
CIS 210 Systems Analysis and Development Week 6 Part II Designing Databases,
Object-Relational Modeling. What Is a Relational Data Model? Based on the concept of relations (tables of data) Relationships established by matching.
Unit 4 Object Relational Modeling. Key Concepts Object-Relational Modeling outcomes and process Relational data model Normalization Anomalies Functional.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
File and Database Design Class 22. File and database design: 1. Choosing the storage format for each attribute from the logical data model. 2. Grouping.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Essentials of Systems Analysis and Design Fourth Edition Joseph S. Valacich Joey F.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter 9 Designing Databases.
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
9-1 © Prentice Hall, 2007 Topic 9: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Chapter 9 Designing Databases 9.1.
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part a): Logical Database Design and the Relational Model Modern Database Management.
6-1 © Prentice Hall, 2007 Topic 6: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A. Hoffer.
8-1 © Prentice Hall, 2007 Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
11-1 © Prentice Hall, 2004 Chapter 11: Physical Database Design Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Logical Design 12/10/2009GAK1. Learning Objectives How to remove features from a local conceptual model that are not compatible with the relational model.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 10 Structuring.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 12 Designing.
Cis339 Modern Systems Analysis and Design Fifth Edition Chapter 10 Designing Databases 10.1.
Converting ER/EER to logical schema; physical design issues 1.
Chapter 10 Structuring System Requirements: Conceptual Data Modeling
Chapter 8: Object-Relational Modeling
Logical Database Design and the Rational Model
Chapter 4 Logical Database Design and the Relational Model
Chapter 4: Logical Database Design and the Relational Model
Chapter 9 Designing Databases
Chapter 5: Logical Database Design and the Relational Model
Physical Database Design and Performance
MIS 322 – Enterprise Business Process Analysis
Modern Systems Analysis and Design Third Edition
Chapter 4 Relational Databases
Translation of ER-diagram into Relational Schema
Chapter 9 Designing Databases
© 2011 Pearson Education, Inc. Publishing as Prentice Hall
Chapter 9 Designing Databases
Chapter 12 Designing Databases
Chapter 10 Structuring System Requirements: Conceptual Data Modeling
Chapter 10 Designing Databases
Chapter 9 Designing Databases
Presentation transcript:

Designing Databases Modern Systems Analysis and Design Fifth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich

© 2008 by Prentice Hall 2 Learning Objectives Concisely define each of the following key database design terms: relation, primary key, normalization, functional dependency, foreign key, referential integrity, file organization, and index. Explain the role of designing databases in the analysis and design of an information system. Explain when to use different types of file organizations to store computer files. Describe the purpose of indexes and the important considerations in selecting attributes to be indexed.

Introduction © 2008 by Prentice Hall 3

4 Chapter 10 Database Design File and database design occurs in two steps.  Develop a logical database model, which describes data using notation that corresponds to a data organization used by a database management system. Relational database model.  Prescribe the technical specifications for computer files and databases in which to store the data. Physical database design provides specifications. Logical and physical database design in parallel with other system design steps.

© 2008 by Prentice Hall 5 The Process of Database Design Four key steps in logical database modeling and design:  Develop a logical data model for each known user interface for the application using normalization principles.  Combine normalized data requirements from all user interfaces into one consolidated logical database model (view integration).  Translate the conceptual E-R data model for the application into normalized data requirements.  Compare the consolidated logical database design with the translated E-R model and produce one final logical database model for the application.

© 2008 by Prentice Hall 6 Key physical database design decisions include:  Choosing storage format for each attribute from the logical database model.  Grouping attributes from the logical database model into physical records.  Arranging related records in secondary memory (hard disks and magnetic tapes) so that records can be stored, retrieved and updated rapidly.  Selecting media and structures for storing data to make access more efficient.

© 2008 by Prentice Hall 7 Chapter 10 Deliverables and Outcomes Logical database design  Must account for every data element on a system input or output.  Normalized relations are the primary deliverable. Physical database design  Convert relations into database tables.  Programmers and database analysts code the definitions of the database.  Written in Structured Query Language (SQL).

© 2008 by Prentice Hall 8 Relational Database Model Relational database model: data represented as a set of related tables or relations. Relation: a named, two-dimensional table of data. Each relation consists of a set of named columns and an arbitrary number of unnamed rows. PEL_No_KP PEL_Nama PEL_Tele PEL_Tarikh PEL_Deposit Ali /5/04 RM Sue /06/04 RM John /03/04 RM50 … PELANGGAN Example of a relation

© 2008 by Prentice Hall 9 Relational Database Model (Cont.) Relations have several properties that distinguish them from nonrelational tables:  Entries in cells are simple.  Entries in columns are from the same set of values.  Each row is unique.  The sequence of columns can be interchanged without changing the meaning or use of the relation.  The rows may be interchanged or stored in any sequence. PEL_No_KP PEL_Nama PEL_Tele PEL_Tarikh PEL_Deposit Ali /5/04 RM Sue /06/04 RM John /03/04 RM50 … PELANGGAN Example of a relation

© 2008 by Prentice Hall 10 Well-Structured Relation and Primary Keys Well-Structured Relation (or table)  A relation that contains a minimum amount of redundancy;  Allows users to insert, modify, and delete the rows without errors or inconsistencies. Primary Key  An attribute whose value is unique across all occurrences of a relation.  All relations have a primary key.  This is how rows are ensured to be unique.  A primary key may involve a single attribute or be composed of multiple attributes. PEL_No_KP PEL_Nama PEL_Tele PEL_Tarikh PEL_Deposit Ali /5/04 RM Sue /06/04 RM John /03/04 RM50 … PELANGGAN Example of a relation

© 2008 by Prentice Hall 11 Normalization and Rules of Normalization Normalization: the process of converting complex data structures into simple, stable data structures. First Normal From (1NF)  Unique rows, no multivalued attributes.  All relations are in 1NF. Second Normal Form (2NF)  Each nonprimary key attribute is identified by the whole key (called full functional dependency). Third Normal Form (3NF)  Nonprimary key attributes do not depend on each other (i.e. no transitive dependencies). The result of normalization is that every nonprimary key attribute depends upon the whole primary key.

© 2008 by Prentice Hall 12 Functional Dependencies and Primary Keys Functional Dependency  A particular relationship between two attributes.  For a given relation, attribute B is functionally dependent on attribute A if, for every valid value of A, that value of A uniquely determines the value of B.  The functional dependence of B on A is represented by A→B. Functional dependency is not a mathematical dependency (i.e., computation). Instances (or sample data) in a relation do not prove the existence of a functional dependency. Knowledge of problem domain is most reliable method for identifying functional dependency. Emp_IDName _______________ 100Mary 200Allen 190Susan EMPLOYEE Emp_ID  Name - Emp_ID value can have only one Name

© 2008 by Prentice Hall 13 Transforming E-R Diagrams into Relations It is useful to transform the conceptual data model into a set of normalized relations. Steps  Represent entities.  Represent relationships.  Normalize the relations.  Merge the relations.

© 2008 by Prentice Hall 14 Representing Entities Each regular entity is transformed into a relation (entity  relation) The identifier of the entity type becomes the primary key of the corresponding relation (identifier  primary key). The primary key must satisfy the following two conditions.  The value of the key must uniquely identify every row in the relation.  The key should be nonredundant. The entity type label is translates into a relation name (entity label  relation name).

Entities in ERD  Relations (Tables) BAHAGIAN nama #telefon ada tempoh kategori Tarikh alamat # KP serta i Jenis tetamu bilangan tetamu Tarikh tempah deposit Jenis majlis PELANGGAN tempa h PROJEK ada namaJenis operasi # k/tgn nama PEKERJA Nama pelanggan

nama #telefon # KP Tarikh tempah deposit PELANGGAN PELANGGAN (#KP, Nama, Telefon, Tarikh_Tempah, Deposit) Entity: Relation: Entities in ERD  Relations (Tables)

Entities  Relations (Tables) PELANGGAN (#KP, Nama, Telefon, Tarikh_Tempah, Deposit) PROJEK (Tarikh_Majlis, Tempoh_Majlis, Nama_Pelanggan, Tarikh_Tempah,Alamat, Kategori, Bil_Tetamu, Jenis_Tetamu, Jenis_Majlis) PEKERJA (Nama, #K/tgn) BAHAGIAN (Nama_Bahagian, Jenis_Operasi)

ERD  Relations (Tables) PEL_No_KP PEL_Nama PEL_Tele PEL_Tarikh PEL_Deposit Ali /5/04 RM Sue /06/04 RM John /03/04 RM50 … PELANGGAN PELANGGAN (Nombor_Kad_Pengenalan, Nama, Nombor_Telefon, Tarikh_Tempahan, Deposit) relation name fields Instances or data

© 2008 by Prentice Hall 19 Represent Relationships The procedure for representing relationships depends on both the degree of the relationship – unary, binary, ternary – and the cardinalities of the relationship. Binary 1:N Relationship: is represented by adding the primary key attribute (or attributes) of the entity on the one side of the relationship as a foreign key in the relation that is on the many side of the relationship. Binary or Unary 1:1 Relationship: represented by any of the following choices:  Add the primary key of A as a foreign key of B.  Add the primary key of B as a foreign key of A.  Both of the above.

© 2008 by Prentice Hall 20 Binary and Higher-Degree M:N relationships  Create another relation and include primary keys of all relations as primary key of new relation. Unary 1:N Relationship  Is modeled as a relation.  Primary key of that relation is the same as for the entity type.  Foreign key is added to the relation that references the primary key values.  Recursive foreign key: A foreign key in a relation that references the primary key values of that same relation. Unary M:N Relationship  Is modeled as one relation.  Create a separate relation the represent the M:N relationship.  Primary key of new relation is a composite key of two attributes that both take their values from the same primary key.  Any attribute associated with the relationship is included as a nonkey attribute in this new relation.

Represent Relationship -- summary Add primary key Add primary key and foreign key Add primary key and recursive foreign key Add foreign key Add primary key and foreign key Registration Create another relation and include primary keys of all relations as primary key of new relation Add primary key and foreign key

© 2008 by Prentice Hall 22 Merging Relations Purpose is to remove redundant relations. The last step in logical database design. Prior to physical file and database design.

View Integration Problems Must understand the meaning of the data and be prepared to resolve any problems that arise in the process. Synonyms: two different names used for the same attribute.  When merging, get agreement from users on a single, standard name. Homonyms: a single attribute name that is used for two or more different attributes.  Resolved by creating a new name. Dependencies between nonkeys: dependencies may be created as a result of view integration.  In order to resolve, the new relation must be normalized. Class/Subclass: relationship may be hidden in user views or relations.  Resolved by creating a new name. © 2008 by Prentice Hall 23

File Organizations File organization: a technique for physically arranging the records of a file. Physical file: a named set of table rows stored in a contiguous section of secondary memory. Pointer: a field of data that can be used to locate a related field or row of data. © 2008 by Prentice Hall 24

© 2008 by Prentice Hall 25 Objectives for choosing file organization  Fast data retrieval.  High throughput for processing transactions.  Efficient use of storage space.  Protection from failures or data loss.  Minimizing need for reorganization.  Accommodating growth.  Security from unauthorized use.  Protection from failures or data loss.  Minimizing need for reorganization.  Accommodating growth.  Security from unauthorized use.

File Organizations (Cont.) Sequential file organization: a file organization in which rows in a file are stored in sequence according to a primary key value. Hashed file organization: a file organization in which the address for each row is determined using an algorithm. Indexed file organization: a file organization in which rows are stored either sequentially or nonsequentially, and an index is created that allows software to locate individual rows.  Index: a table used to determine the location of rows in a file that satisfy some condition.  Secondary keys: one or a combination of fields for which more than one row may have the same combination of values. © 2008 by Prentice Hall 26

Indexed File Organization (Cont.) Main disadvantages are:  Extra space required to store the indexes; and  Extra time necessary to access and maintain indexes. Main advantages are:  Allows for both random and sequential processing. Guidelines for choosing indexes:  Specify a unique index for the primary key of each table.  Specify an index for foreign keys.  Specify an index for nonkey fields that are referenced in qualification, sorting and grouping commands for the purpose of retrieving data. © 2008 by Prentice Hall 27

© 2008 by Prentice Hall 28 Summary In this chapter you learned how to: Concisely define each of the following key database design terms: relation, primary key, normalization, functional dependency, foreign key, file organization, and index. Explain the role of designing databases in the analysis and design of an information system. Explain when to use different types of file organizations to store computer files. Describe the purpose of indexes and the important considerations in selecting attributes to be indexed.