We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byRowan Braddock
Modified over 2 years ago
Chapter 4 Database Design Chapter4.1 Copyright © 2014 Pearson Education Inc.
Copyright ©2014 Pearson Education, Inc. Logical Design Logical design is the entity design without regard to a relational database management system. One of the principles of relational database is that the logical design should be the same regardless of the DBMS that will be used. This means you dont consider the particular limitations or features of a DBMS in the design. Chapter4.2
Copyright ©2014 Pearson Education, Inc. Physical Design Physical design is the logical design adapted to a particular DBMS. The design can change slightly to fit into the limitations of a DBMS or to take advantage of DBMS-specific features. Chapter4.3
Copyright ©2014 Pearson Education, Inc. Entity Relation Diagrams Entity relation diagrams are a common way of diagramming entities, their attributes, and their relationships. An entity is represented as a rectangle divided into three parts: The name of the entity The primary key The attributes Chapter4.4
Copyright ©2014 Pearson Education, Inc. An Entity Attributes in bold are required Chapter4.5
Copyright ©2014 Pearson Education, Inc. Relationships A relationship between entities is established by repeating one field, usually the primary key field, from one table in a second table, usually as a foreign key. The primary key table is sometimes referred to as the parent table. Tables with the foreign keys are referred to as child tables. Chapter4.6
Copyright ©2014 Pearson Education, Inc. Crows Feet Notation for Relationships The three lines, the crows foot, shows the many side of the relationship. The 0 on the building side says a building can have zero or many rooms, the line on the room side says a room must have a building. Chapter4.7
Copyright ©2014 Pearson Education, Inc. Naming Conventions Naming conventions are crucial for good design. Ideally you should have a consistent way of naming database objects, such as tables, attributes, keys, and any other database objects, such as stored procedures and triggers. Chapter4.8
Copyright ©2014 Pearson Education, Inc. Book Naming Conventions Entities and tables are named as single nouns like Tutor, Student, and Session. Attributes are named with the entity name followed by the attribute name. There are no underscores between. Each new word is capitalized: TutorLastName, StudentLastName, and so on. This can make for long attribute names, but it makes for maximum clarity. Primary keys end with the word Key: TutorKey, StudentKey, and so on. Foreign keys retain the name of the primary key. Chapter4.9
Copyright ©2014 Pearson Education, Inc. Term Equivalencies Logical DesignPhysical designTheoretical EntityTableRelation AttributeColumn, fieldAttribute Row, recordTuple Chapter4.10
Copyright ©2014 Pearson Education, Inc. Repeating Fields When creating an entity that can contain many of the same attributes, it is tempting to list or number them. For example, a tutor can tutor many classes. The temptation is to create an entity like the following (see next slide): Chapter4.11
Copyright ©2014 Pearson Education, Inc. Repeating Attribute Entity Chapter4.12
Resolution Numbering attributes is always a mistake. It is a sign that you should split the entity into two separate entities Chapter4.13 Copyright © 2014 Pearson Education Inc.
Copyright ©2014 Pearson Education, Inc. Relationships There are three types of relationships between entities: One to one One to many Many to many Chapter4.14
Copyright ©2014 Pearson Education, Inc. One to One A one-to-one relationship means that for every one record in the primary key table, there is no more than one related record in the foreign key table. Below are the crows feet notation for this relationship: Zero or one Exactly one Chapter4.15
Copyright ©2014 Pearson Education, Inc. Notes on One-to-One Relationships One-to-one relationships are rare. They can be used to rid an entity of null (empty) attributes that inevitably result when contents of an entity have different attributes. They are sometimes used when data is split between entities for security reasons. Chapter4.16
Copyright ©2014 Pearson Education, Inc. One-to-One Relationship to Prevent Nulls Chapter4.17
Copyright ©2014 Pearson Education, Inc. Table Example: One to One For Reducing Nulls Chapter4.18
Copyright ©2014 Pearson Education, Inc. One to One for Security Reasons Chapter4.19
Copyright ©2014 Pearson Education, Inc. One to Many One to many is the normal relationship between tables. It means that for every one record in the parent entity, there can be zero to infinity records in the child entity. Here are the crows feet symbols for one to many relationships: One to zero or many At least one or many Chapter4.20
Copyright ©2014 Pearson Education, Inc. One to Many Diagram One Department can contain many Employees Chapter4.21
Copyright ©2014 Pearson Education, Inc. Table Example of One to Many DepartmentKeyDepartmentNameDepartmentPhoneDepartmentRoom ACCAccounting(206)555-1234SB201 ITInformation Technology (206)555-2468NB100 EmployeeKeyEmployeeLastNameEmployeeFirstNameDepartmentKey FB2001DCollinsRichardIT BN2004NFaulknerLeonoreIT NC2004MBrownCarolACC LL2006OAndersonThomasIT Chapter4.22
Copyright ©2014 Pearson Education, Inc. Caution: Cross Relationship Error There is a temptation to think that because a department contains many employees, that the relationship should go both ways. Doing this, however, makes it impossible to enter data since before you enter a department, there must be an existing employee in the Employee table, and before you enter an employee, there must be an existing department in the Department table. The result is an unusable stalemate. Chapter4.23
Copyright ©2014 Pearson Education, Inc. Many to Many A many-to-many relationship means that each record in the primary entity can have many related records in a second entity and each record in the second entity can have many related records in the primary entity. Many-to-many relationships are legal in logical design, but no DBMS can implement them. Chapter4.24
Copyright ©2014 Pearson Education, Inc. Example of a Many-to-Many Entity Relationship Chapter4.25
Copyright ©2014 Pearson Education, Inc. Resolving Many-to-Many Relationships Many-to-many relationships must be resolved into two one-to- many relationships. To do this, it is necessary to create a linking between the two tables that have many-to-many relationships. Chapter4.26
Copyright ©2014 Pearson Education, Inc. Many-to-Many Relationship Resolved Chapter4.27
Copyright ©2014 Pearson Education, Inc. Table View: Magazine and Subscriber MagazineKeyMagazineNameMagazinePrice TM2K1Time35.50 NW2K1Newsweek36.40 SubscriberKey Subscriber LastName Subscriber FirstName Subscriber Address Subscriber City Subscriber State Subscriber PostalCode 4231JohnsonLeslie101 Best Ave.SeattleWA98007 4333AndersonMark 1200 Western Blvd. TacomaWA98011 5344ManningTabitha100 WestlakeSeattleWA98008 Chapter4.28
Copyright ©2014 Pearson Education, Inc. Linking Table: Subscription SubscriptionKeyMagazineKeySubscriberKeySubscriptionStartDate 1004TM2K143331/15/2009 1005NW2K143331/15/2009 1006NW2K142312/1/2009 1007TM2K153442/15/2009 Chapter4.29
Copyright ©2014 Pearson Education, Inc. Cardinality Cardinality describes the number of permissible relationships between two entities. Maximum cardinality refers to the maximum number of permitted relationships. (For example, a customer can have no more than 4 listed emails.) Minimum cardinality refers the minimum number of permitted relationships. (For example, each customer must have at least one purchase in the purchase table.) Chapter4.30
Copyright ©2014 Pearson Education, Inc. Types or Roles of Entities Entities can take on different roles. Below is a table of some common roles or types: Entity RolesDescription DomainEntity describing a core business element of the database Linking Entity used to resolve a many-to-many relationship into two one-to-many relationships Lookup Entity used to store lookup values and help ensure data integrity and consistency WeakAn entity that depends on another entity for its meaning Chapter4.31
Copyright ©2014 Pearson Education, Inc. Example of a Weak Entity An employee can have many dependents, so it is a good design practice to create a separate entity to describe dependents. However, the Dependent entity is a weak entity because it depends on Employee for its meaning. Chapter4.32
Copyright ©2014 Pearson Education, Inc. Documentation Diagrams often communicate more clearly than words. It is important to keep all your entity diagrams for documentations along with notations about changes and versions. Chapter4.33
Copyright ©2014 Pearson Education, Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. Chapter4.34
IT203 Unit 3: Database Design
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
© Paradigm Publishing, Inc Access 2010 Level 1 Unit 1Creating Tables and Queries Chapter 2Creating Relationships between Tables.
Chapter 1 The Study of Body Function Image PowerPoint
+ Database Design: Conceptual Model to Logical Model (ER diagrams to tables)
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 12 View Design and Integration.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
© 2012 National Heart Foundation of Australia. Slide 2.
Systems Analysis and Design 5th Edition Chapter 6. Data Modeling Roberta Roth, Alan Dennis, and Barbara Haley Wixom 6-0© Copyright 2011 John Wiley & Sons,
PSSA Preparation. Question 1(no calculator) D Question 2 (no calculator)
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
Murach's PHP and MySQL, C15© 2010, Mike Murach & Associates, Inc.Slide 1.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
IT203 Unit 9: Database Security II Is It Secure? Copyright © 2012 Pearson Education, Inc. Publishing as Prentice HallChapter8.1.
Chapter 11 Membrane Structure Essential Cell Biology Third Edition Copyright © Garland Science 2010.
Chapter 15 Intracellular Compartments and Transport Essential Cell Biology Third Edition Copyright © Garland Science 2010.
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
Information Systems Today: Managing in the Digital World TB3-1 3 Technology Briefing Database Management Modern organizations are said to be drowning in.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Access 2010 by Robert Grauer, Keith Mast, Mary Anne Poatsy Chapter.
Chapter Ten Marketing Communications and Customer Response.
Time for a BREAK! You have 45 Minutes. Time Left 44.
Prof. Valter Bezerra Dantas
Speak Up for Safety Dr. Susan Strauss Harassment & Bullying Consultant November 9, 2012.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Five: Data Modeling with the Entity-Relationship.
FIRST COURSE Microsoft Access. XP 2 Organizing Data Your first step in organizing data is to identify the individual fields – The specific value, or content,
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Five: Data Modeling with the Entity-Relationship.
Copyright © 2008 Cengage Learning Understanding Generalist Practice, 5e, Kirst-Ashman/Hull 1.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 1 Skills for Success with Office 2010 Vol. 1 PowerPoint Lecture to Accompany Skills.
Database Design Chapter Five DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
Peterson’s Practice AP Exam
Chapter 14 Energy Generation in Mitochondria and Chlorplasts Essential Cell Biology Third Edition Copyright © Garland Science 2010.
Chapter 12 Membrane Transport Essential Cell Biology Third Edition Copyright © Garland Science 2010.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
16-1 Retail Mgt. 11e (c) 2010 Pearson Education, Inc. publishing as Prentice Hall Financial Merchandise Management RETAIL MANAGEMENT: A STRATEGIC APPROACH.
Fundamentals, Design, and Implementation, 9/e Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
1 Chapter 13 Nuclear Magnetic Resonance Spectroscopy.
11 International Strategy and Organization Copyright © 2014 Pearson Education, Inc.
Model and Relationships 6 M 1 M M M M M M M M M M M M M M M M
Chapter 10 Analyzing Genes and Genomes Essential Cell Biology Third Edition Copyright © Garland Science 2010.
McDonald’s calendar 2009 January
Factor P (8-5ab) 2. 4(d² + 4) 3. 3rs(2r – s) 4. 15cd(1 + 2cd) 5. 8(4a² + 3b²) 6. 12xy(3y – 4x) 7. 5x²y(6x + 7y) 8. 3cd²(3c² - 2d) 9. 15bc³(5b +
© 2008 Pearson Addison Wesley. All rights reserved Chapter Seven Costs.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 1 Embedded Computing.
25 seconds left….. 24 seconds left….. 23 seconds left…..
© 2017 SlidePlayer.com Inc. All rights reserved.