Introduction to Databases

Slides:



Advertisements
Similar presentations
Database Design Process
Advertisements

© Copyright 2011 John Wiley & Sons, Inc.
Chapter 15 Creating Database Forms and Reports Introduction Forms Reports.
Chapter 5: Database Forms and Reports
© Copyright 2011 John Wiley & Sons, Inc.
ACCOUNTING INFORMATION SYSTEMS
Chapter Chapter 13-2 Chapter 13 Data Modeling Introduction An Overview of Databases Steps in Creating a Database Using Rea Creating Database Tables.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
Chapter 14 Organizing and Manipulating the Data in 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 101 Information Technology For Management 6 th Edition Turban, Leidner, McLean, Wetherbe Lecture Slides by L. Beaubien, Providence College John.
© Copyright 2011 John Wiley & Sons, Inc.
Chapter 5 The Relational Database Model: Introduction
Chapter 3: Data Modeling
Managerial Accounting by James Jiambalvo
Chapter 3 Data Modeling Fundamentals of Database Management Systems by
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management.
Chapter 7 Logical Database Design
Chapter 6 The Relational Database Model: Additional Concepts
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management.
Introduction to Databases Chapter 1: Introducing Data and Data Management.
PowerPoint Presentation for Dennis, Wixom, & Roth Systems Analysis and Design, 3rd Edition Copyright 2006 © John Wiley & Sons, Inc. All rights reserved..
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
Introduction to Databases Chapter 7: Data Access and Manipulation.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Fundamentals of Database Management Systems, 2nd ed
Concepts and Terminology Introduction to Database.
Chapter 4: Organizing and Manipulating the Data in Databases
Today’s Agenda  Any questions about the assignment (due Mon)?  Quiz  Quiz review  Homework for Friday:  Watch the two videos on the Coursera db website.
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design Copyright 2000 © John Wiley & Sons, Inc. All rights reserved. Slide 1 Systems.
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Chapter 8 Physical Database Design
Chapter Chapter 13-2 Accounting Information Systems, 1 st Edition Data and Databases.
Core Concepts of ACCOUNTING INFORMATION SYSTEMS Moscove, Simkin & Bagranoff John Wiley & Sons, Inc. Developed by: Marianne Bradford, Ph.D. Bryant College.
Chapter 111 Information Technology For Management 6 th Edition Turban, Leidner, McLean, Wetherbe Lecture Slides by L. Beaubien, Providence College John.
Copyright © 2000 John Wiley & Sons, Inc. All rights reserved
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Core Concepts of ACCOUNTING INFORMATION SYSTEMS Moscove, Simkin & Bagranoff John Wiley & Sons, Inc. Developed by: S. Bhattacharya, Ph.D. Florida Atlantic.
Chapter 4-1. Chapter 4-2 Chapter 4: Data Modeling Introduction An Overview of Databases Steps in Creating a Database Using REA Creating Database Tables.
Copyright © 2000 John Wiley & Sons, Inc. All rights reserved. Reproduction or translation of this work beyond that permitted in Section 117 of the 1976.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Essentials of Systems Analysis and Design Fourth Edition Joseph S. Valacich Joey F.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
Introduction to Drafting and Design
Copyright © 2000 John Wiley & Sons, Inc. All rights reserved. Reproduction or translation of this work beyond that permitted in Section 117 of the 1976.
Copyright 2006 John Wiley & Sons, Inc. Beni Asllani University of Tennessee at Chattanooga Operations Management - 5 th Edition Chapter 10 Supplement Roberta.
Logical Database Design and the Relational Model.
Introduction to Information Technology Turban, Rainer and Potter John Wiley & Sons, Inc. Copyright 2005.
Slide 8-1 Chapter 8 Terms Programming Languages Introduction to Information Systems Judith C. Simon.
McGraw-Hill/Irwin Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Modeling the Data: Conceptual and Logical Data Modeling.
Chapter 5-1. Chapter 5-2 Chapter 5: Organizing and Manipulating the Data in Databases Introduction Normalization Validating the Data in Databases Extracting.
A- 1. A- 2 Appendix B Standards of Ethical Conduct for Management Accountants The Institute of Management Accountants has published and promoted the following.
K-1. K-2 Appendix K Standards of Ethical Conduct for Management Accountants The Institute of Management Accountants has published and promoted the following.
Normalization. Overview Earliest  formalized database design technique and at one time was the starting point for logical database design. Today  is.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 12 Designing.
I-1. I-2 I ACCOUNTING FOR SOLE PROPRIETORSHIPS Accounting, Fifth Edition.
H-1 Prepared by Coby Harmon University of California, Santa Barbara Westmont College.
Slide 6-1 Chapter 6 Terms System Software Considerations Introduction to Information Systems Judith C. Simon.
Systems Analysis and Design
Systems Analysis and Design
Physical Changes That Don’t Change the Logical Design
Prepared by Debby Bloom-Hill CMA, CFM
Systems Analysis and Design
ACCOUNTING INFORMATION SYSTEMS
Presentation transcript:

Introduction to Databases Copyright by John Wiley and Sons, 2006 Introduction to Databases Chapter 4: Designing a Database

Designing Relational Tables Copyright by John Wiley and Sons, 2006 Designing Relational Tables Typical process for converting E-R diagrams to relational tables: Each entity converts to table For many-to-many relationships, each associative entity converts to table Attributes become table columns Ensure foreign keys appear in proper places in tables To convert single entity, create table of same name with column for each attribute

Salesperson Entity and Table Copyright by John Wiley and Sons, 2006 Salesperson Entity and Table

Converting Binary Relationships Copyright by John Wiley and Sons, 2006 Converting Binary Relationships Greater importance in selecting identifier and primary key Identifier and primary key define foreign key that establishes relationships between tables Often more than one way to represent entity relationships as relational tables

Example: Converting 1-1 Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-1 Binary Relationship

Example: Converting 1-1 Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-1 Binary Relationship

Example: Converting 1-1 Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-1 Binary Relationship

Example: Converting 1-1 Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-1 Binary Relationship Converting one-to-one Salesperson/Office relationship Options: Convert relationship to single/combined table Convert relationship to two tables

Example: Converting 1-1 Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-1 Binary Relationship Considerations: Business environment considers Salesperson and Office as separate entities Modality of zero at Salesperson entity in E-R diagram (office may have no one assigned) Salesperson entity in E-R diagram has relationships with other entities

Example: Converting 1-1 Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-1 Binary Relationship Solution 1: Combine two entities into one table

Example: Converting 1-1 Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-1 Binary Relationship Solution 2: Two separate tables Office Number as foreign key in Salesperson table

Example: Converting 1-1 Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-1 Binary Relationship Solution 3: Two separate tables Salesperson Number as foreign key in Office table

Example: Converting 1-M Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-M Binary Relationship

Example: Converting 1-M Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-M Binary Relationship Each occurrence of Salesperson is related to zero or more occurrences of Customer Unique identifier of entity on “one” side is placed as foreign key in entity of “many” side

Example: Converting 1-M Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-M Binary Relationship

Example: Converting M-M Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting M-M Binary Relationship

Example: Converting M-M Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting M-M Binary Relationship Most relational DBMS systems do not directly support many-to-many relationships Solution: Include associative entity to establish relationship May use composite key as primary key in associative entity

Example: Converting M-M Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting M-M Binary Relationship

Example: Converting M-M Binary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting M-M Binary Relationship

Example: Converting 1-1 Unary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-1 Unary Relationship

Example: Converting 1-1 Unary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-1 Unary Relationship With: Only one entity type involved, and One-to-one relationship Conversion requires only one table

Example: Converting 1-M Unary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-M Unary Relationship

Example: Converting 1-M Unary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting 1-M Unary Relationship

Example: Converting M-M Unary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting M-M Unary Relationship Many-to-many unary relationship: For example: one product can be constructed out of set or subset of other products General rule in conversion: Number of tables equal to number of entity types plus one more table for many-to-many relationship M-M unary relationship - 2 tables M-M binary relationship - 3 tables M-M ternary relationship - 4 four tables

Example: Converting M-M Unary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting M-M Unary Relationship

Example: Converting M-M Unary Relationship Copyright by John Wiley and Sons, 2006 Example: Converting M-M Unary Relationship

Example: Good Reading Bookstores Copyright by John Wiley and Sons, 2006 Example: Good Reading Bookstores

Example: Good Reading Bookstores Copyright by John Wiley and Sons, 2006 Example: Good Reading Bookstores

Example: Good Reading Bookstores Copyright by John Wiley and Sons, 2006 Example: Good Reading Bookstores

Copyright by John Wiley and Sons, 2006 Normalizing Data Data normalization: Methodology for organizing attributes into tables to eliminate redundancy among nonkey attributes Goals: Each resultant table describes single entity type or single many-to-many relationship Foreign keys appear exactly where needed Properly structured relational database

Normalization Techniques Copyright by John Wiley and Sons, 2006 Normalization Techniques Two types of input needed for data normalization process List of all attributes to be incorporated in database, including intersection data attributes List of functional dependencies: all defining associations between attributes In functional dependencies, one attribute (determinate attribute) defines value of another attribute Salesperson Number → Salesperson Name

Salesperson Entity Attributes Copyright by John Wiley and Sons, 2006 Salesperson Entity Attributes

Salesperson Entity Functional Dependencies Copyright by John Wiley and Sons, 2006 Salesperson Entity Functional Dependencies

Example: Defining Attributes and Functional Dependencies Copyright by John Wiley and Sons, 2006 Example: Defining Attributes and Functional Dependencies Quantity is defined by two combined attributes Manager is defined independently by two attributes Department Number and Salesperson Number Salesperson Number also defines Department Number

Copyright by John Wiley and Sons, 2006 Normalizing Data Normal forms: Rules for data normalization Three main normal forms First normal form Second normal form Third normal form Normalization: Uses normal forms to step through “decomposition process” that decomposes attributes into subgroups In third normal form, group of tables is well-structured relational database with no data redundancy

Copyright by John Wiley and Sons, 2006 Normalizing Data First normal form: Eliminates multiple values Second normal form: Eliminates partial functional dependencies (data dependent on part of primary key) Every nonkey attribute must be fully functionally dependent on entire key of table Third normal form: Eliminates transitive dependencies (one nonkey attribute is functionally dependent on another) Nonkey attributes are not allowed to define other nonkey attributes

Example: Unnormalized Data Copyright by John Wiley and Sons, 2006 Example: Unnormalized Data

Copyright by John Wiley and Sons, 2006 First Normal Form

Copyright by John Wiley and Sons, 2006 Second Normal Form

Copyright by John Wiley and Sons, 2006 Third Normal Form

Copyright by John Wiley and Sons, 2006 Denormalizing Data Denormalizing may be needed when: Normalization has been taken to extreme Too many small tables creating more work and storage space E.g. Using State table to be referenced instead of entering two-digit code) More efficient data retrieval is needed: Many queries requiring resource-intensive joining In denormalizing, you join two or more tables into one less normalized table

Copyright by John Wiley and Sons, 2006 Summary In converting E-R diagrams to relational tables, each entity typically converted into table, with attributes as table columns. Considerations in conversion: Business needs, cardinalities, modalities, and defining foreign keys to establish relationships. Normalization: Uses three main normal forms to step through “decomposing” attributes into subgroups that allow data redundancies to be eliminated. Denormalizing may be needed in cases where storage space and speed of data retrieval are important factors.

Copyright by John Wiley and Sons, 2006 Key Terms Composite key Data integrity Data normalization Decomposition process Defining association Determinant attribute Exception conditions First normal form Functional dependency Joining Non-loss decomposition Normal forms Null value Partial functional dependency Referential integrity Relational integrity Second normal form Third normal form (3NF) Transitive dependency

Copyright by John Wiley and Sons, 2006 Copyright Notice Copyright 2008 John Wiley & Sons, Inc. All rights reserved. Reproduction or translation of this work beyond that permitted in section 117 of the 1976 United States Copyright Act without express permission of the copyright owner is unlawful. Requests for further information should be addressed to the Permissions Department, John Wiley & Sons, Inc. The purchaser may make back-up copies for his/her own use only and not for distribution or resale. The Publisher assumes no responsibility for errors, omissions, or damages caused by the use of these programs or from the use of the information herein.