Relationships—Topics

Slides:



Advertisements
Similar presentations
Chapter # 4 BIS Database Systems
Advertisements

Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
Entity-Relation Modeling Hun Myoung Park, Ph.D., Public Management and Policy Analysis Program Graduate School of International Relations International.
Chapter 6 Methodology Logical Database Design for the Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 1 Data Models: Degrees of Data Abstraction l Modified ANSI/SPARC Framework.
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
APPENDIX C DESIGNING DATABASES
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Chapter 5 Entity Relationship (ER) Modelling
Chapter 5 Entity–Relationship Modeling
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
IMS 6217: Relationships 1 Dr. Lawrence West, MIS Dept., University of Central Florida Database Design--Topics DB Design Steps Identify.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Chapter 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
Initial Design of Entity Types for the COMPANY Database Schema Based on the requirements, we can identify four initial entity types in the COMPANY database:
IMS 4212: Data Modeling—More Relationships 1 Dr. Lawrence West, Management Dept., University of Central Florida Data Modeling—Topics.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
Database Design – Lecture 5 Conceptual Data Modeling – adding attributes.
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.
IMS 4212: Introduction to Data Modeling—Relationships 1 Dr. Lawrence West, Management Dept., University of Central Florida Relationships—Topics.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 4 ENTITY RELATIONSHIP (ER) MODELING Instructor Ms. Arwa Binsaleh 1.
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
Entity Relationship (E-R) Model
COP Introduction to Database Structures
Data Modeling Using the ERD
Logical Database Design and the Rational Model
Business System Development
Chapter 5 Database Design
Entity Relationship Diagram
Methodology Logical Database Design for the Relational Model
TMC2034 Database Concept and Design
Chapter 4: Part B Logical Database Design and the Relational Model
Entity Relationship (E-R) Modeling
© The McGraw-Hill Companies, All Rights Reserved APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
Entity Relationship (E-R) Modeling
DESIGNING DATABASE APPLICATIONS
Tables and Their Characteristics
Database Design – Lecture 4
Entity-Relationship Modeling
Chapter 9 Designing Databases
Entity-Relationship Modeling
Chapter 4 Entity Relationship (ER) Modeling
Entity-Relation Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Database Systems Instructor Name: Lecture-11.
Database Modeling using Entity Relationship Model (E-R Model)
Review of Week 1 Database DBMS File systems vs. database systems
Chapter 3: Modeling Data in the Organization
Relationships—Topics
Relationships—Topics
Chapter 4 Entity Relationship (ER) Modeling
Relationship Problems—Topics
ER MODELING Instructor: SAMIA ARSHAD
Entity Relationship (ER) Modeling
Chapter # 4 Entity Relationship (ER) Modeling.
Presentation transcript:

Relationships—Topics Goal of the Relational Data Model Introducing Relationships Relationship Notation Schemes Binary Relationships Relationship Cardinality & Notation Policy and Cardinality Recursive (Unary) Relationships Ternary (n-ary) Relationships Relationships with Attributes Foreign Keys Parent-Child Relationships Strong-Weak Entities

Identify “Information Elements” Identify Entities Database Design Steps Identify “Information Elements” Identify Entities Identify Primary Keys Identify Relationships Fix Relationship Problems Identify Non-Key Attributes Fix Attribute Problems Address Performance Issues Build Application Objects (stored procedures, views) Design Reports List is not strictly sequential Some steps performed recursively Some steps require returning to previous steps

The Goal of the Relational Data Model Recall that entities hold data about one type of object or event of interest to the organization A goal of the relational data model is to minimize the amount of stored data subject to: Necessity to record data needed by the organization Necessity to maintain relationships

The Goal of the Relational Data Model (cont). Data minimization is achieved by removing any redundant data Achieved through good entity and relationship design Normalization Our approach Design properly normalized (minimal redundancy) data structures Selectively denormalize (introduce redundancy) to improve performance

The Goal of the Relational Data Model (cont). DB design results in many tables, sometimes for simple organizational needs Identifying entities from information requirements analysis Creating new entities to fix attribute-level and relationship problems (covered soon) Relationships between tables enable us to reconnect data that is dispersed into many tables Relationships allow the system to reconstruct the logic of a transaction from dispersed tables

Introducing Relationships Relationships are defined in three ways In data modeling by conceptually identifying and documenting the fact that two entities do relate to each other In data modeling by identifying shared attributes between the two entities (primary key / foreign key) In the physical database by implementing common attributes and declaring the relationship

Two Notation Schemes (Chen LDM) Relationships are connected to entities by notation to indicate the cardinality of the relationship Entities are indicated by a box with the entity name inside Relationships are indicated by diamonds Attributes are listed in ovals attached to entities

Two Notation Schemes (Alternative LDM) Relationship shown without the diamond Entity name Attributes Entities shown as boxes

Binary Relationships The most commonly found relationship is between two entities (binary) Chen Diagram Entities Relationship Entities Cardinality Cardinality My Approach

Unary Relationships Unary relationships are relationships between an entity and itself One employee supervises many other employees; each employee is supervised by, at most, one other employee One part is a component of many other parts; One part (assembly) contains many other parts

Ternary Relationships A ternary relationship is one between three entities This relationship is for modeling and discovery only Model the relationship the way the user describes it Recognize that there are problems with implementing this relationship Relationship will be decomposed into multiple binary relationships for the final ERD (What is the solution?)

Attributes on Relationships The modeling process will sometimes produce attributes of relationships These also will be eliminated in the final ERD (What is the solution?) Look for the missing entity and implement it now

Multiple Relationships Sometimes there can be two relationships between the same two entities

Implementing Relationships Relationships are implemented by sharing attributes between entities When the Identifier Attribute of one entity appears as an attribute in another entity set a relationship is established (whether you intended it or not) These shared identifier attributes are called foreign keys (more next time) Identifier Attribute Shared Identifier Attribute

These attributes are called Foreign Keys in the other entity Relationships are established when the Primary Key attribute(s) of one entity is/are found in another entity These attributes are called Foreign Keys in the other entity Foreign Keys

Parent & Child Relationships (Terminology) The entity contributing the primary key is the parent The entity receiving the foreign key is the child Foreign Keys always, always, always go on the ‘many’ side of a 1:M relationship Shared Identifier Attribute (Foreign Key) Parent Child Identifier Attribute

Strong & Weak Entity Types Traditional definitions: Strong entity type exists independently of any other entity Weak entity type depends on some other entity type Strong Entity Type Weak Entity Type

Strong & Weak Entity Types (cont.) Identifying weak entities will often not happen until identifier attributes are specified When the Identifier Attribute of one entity set appears as an attribute in another entity set a relationship is established If the foreign key in the child table is not part of the child's PK the child is a strong entity Identifier Attribute Shared Identifier Attribute

Strong & Weak Entity Types (cont.) When the identifying attribute of one entity appears as part of a composite identifying attribute set in another entity the child entity is a weak entity Dept Code part of Course PK Indicates Weak Entity in some documentation styles (We will not use.) Parent (Strong) Child (Weak)

Strong vs. Weak Entity Types (Terminology) The identifying attribute that appears in the composite identifying attribute in a weak entity is sometimes called a cascading primary key. These primary key attributes can sometimes cascade through three or more entities Do not confuse mandatory relationships with weak entities