More Diagramming & Practice with Relationship Modeling

Slides:



Advertisements
Similar presentations
ER Modeling Case Studies
Advertisements

Chapter 2.1 V3.1 Napier University Dr Gordon Russell
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
ENTITY RELATIONSHIP MODELLING
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
ERD diagram Data Design - Mr. Ahmad Al-Ghoul
Concepts of Database Management Seventh Edition Chapter 6 Database Design : ERD Model.
Chapter 4 Entity Relationship (E-R) Modeling
Entity Relationship (ER) Modeling
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Data Modeling using the Entity-Relationship (ER) Model
Data Modeling and Relational Database Design ISYS 650.
Agenda for Week 1/31 & 2/2 Learn about database design
ENTITY RELATIONSHIP DATA MODEL ELIZABETH GEORGE. INTRODUCTION Architect Aeronautical engineers Computer architects Traffic engineers.
System Analysis and Design
CSCI 242 Relational Data Modeling Copyright 2011, David C. Roberts, all rights reserved.
CSCI 6442 Entity-Relation Data Modeling Copyright 2012, David C. Roberts, all rights reserved.
APPENDIX C DESIGNING DATABASES
Entity Relationship Modeling Objectives: To illustrate how relationships between entities are defined and refined. To know how relationships are incorporated.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke’s Chapter Five: Data Modeling with the Entity-Relationship.
IT 244 Database Management System Data Modeling 1 Ref: A First Course in Database System Jeffrey D Ullman & Jennifer Widom.
File and Database Design SYS364. Today’s Agenda WHTSA DBMS, RDBMS, SQL A place for everything and everything in its place. Entity Relationship Diagrams.
Business Process Modeling
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Database Design Sections 6 & 7 Second Normal Form (2NF), Unique Identifiers (UID), Third Normal Form (3NF), Arcs, Hierarchies and Recursive relationships.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
CSC 240 (Blum)1 Introduction to Database. CSC 240 (Blum)2 Data versus Information When people distinguish between data and information, –Data is simply.
Database Design Principles – Lecture 3
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T5: Designing Database Applications Business Driven Technology.
Chapter 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
Entity-Relationship (ER) Modelling ER modelling - Identify entities - Identify relationships - Construct ER diagram - Collect attributes for entities &
1 Entity-Relationship Diagram. 2 Components of ERD: –Entity –Relationship –Cardinality –Attributes.
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.
Description and exemplification of entity-relationship modelling.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
EntityRelationshipDiagrams. Entity Relationship Models The E-R (entity-relationship) data model views the real world as a set of basic objects (entities)
Detailed Data Modeling. Outline Data Modeling Modeling Constructs –Entities –Relationships –Cardinality Model Basic Rules Advanced Rules Prototyping Process.
1 Information System Analysis Topic-3. 2 Entity Relationship Diagram \ Definition An entity-relationship (ER) diagram is a specialized graphic that illustrates.
Tutorial on E-R Diagrams 1.Learn basic terminology and symbols –See next four slides; refer to as needed in steps 2-4 below 2.Learn the basics of E-R diagramming.
ERD :: 19 / 1 / Entity-Relationship (ER) Modeling. ER Modeling is a top-down approach to database design. Entity Relationship (ER) Diagram –A.
Entity Relationship Diagram ERD. Background Peter Chen developed ERDs in Charles Bachman and James Martin have added some slight refinements to.
DATA MODELING AND ENTITY-RELATIONSHIP MODEL II IST 210: Organization of Data IST210 1.
1 Database Design Sections 6 & 7 First Normal Form (1NF), Second Normal Form (2NF), Unique Identifiers (UID), Third Normal Form (3NF), Arcs, Hierarchies.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Copyright © 2014 Pearson Canada Inc. 5-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5a Database Design Part 2: Using Information Technology.
Comp 1100 Entity-Relationship (ER) Model
Database Design Chapters 17 and 18.
Entity Relationship Modeling
DATA MODELING AND DATABASE DESIGN
Let try to identify the conectivity of these entity relationship
Entity Relationship Diagram
Entity-Relationship Model
Tables and Their Characteristics
Database Design – Lecture 4
ERD :: 19 / 1 / Entity-Relationship (ER) Modeling. ER Modeling is a top-down approach to database design. Entity Relationship (ER) Diagram –A.
Database Systems: Design, Implementation, and Management Tenth Edition
MIS2502: Data Analytics Relational Data Modeling
Database Design Chapters 17 and 18.
MIS2502: Data Analytics Relational Data Modeling
Chapter 1: The Database Environment
CHAPTER 2 - Database Requirements and ER Modeling
MIS2502: Data Analytics Relational Data Modeling 2
Entity Relation Model Tingting Zhang.
Database Management system
Database Management system
ER MODELING Instructor: SAMIA ARSHAD
DATA MODELING AND DATABASE DESIGN
Presentation transcript:

More Diagramming & Practice with Relationship Modeling

ER Notation There is no standard for representing data objects in ER diagrams. Each modeling methodology uses its own notation. The original notation used by Chen is widely used in academics texts and journals but rarely seen in either CASE tools or publications by non-academics. Today, there are a number of notations used, among the more common are Bachman, crow's foot, and IDEFIX. All notational styles represent entities as rectangular boxes and relationships as lines connecting boxes. Each style uses a special set of symbols to represent the cardinality of a connection. The symbols used for the basic ER constructs are: Entities are represented by labeled rectangles. The label is the name of the entity. Entity names should be singular nouns. Relationships are represented by a solid line connecting two entities. The name of the relationship is written above the line. Relationship names should be verbs. Attributes, when included, are listed inside the entity rectangle. Attributes which are identifiers are underlined. Attribute names should be singular nouns. Cardinality of many is represented by a line ending in a crow's foot. If the crow's foot is omitted, the cardinality is one. Existence is represented by placing a circle or a perpendicular bar on the line. Mandatory existence is shown by the bar (looks like a 1) next to the entity for an instance is required. Optional existence is shown by placing a circle next to the entity that is optional.

Steps In Building the Data Model While ER model lists and defines the constructs required to build a data model, there is no standard process for doing so. Typically, the entities and relationships are modeled first, followed by key attributes, and then the model is finished by adding non-key attributes. The sequence used for this course are: Identification of data objects and relationships Drafting the initial ER diagram with entities and relationships Refining the ER diagram Add key attributes to the diagram Adding non-key attributes Validating the model through normalization Adding integrity rules to the Model

Single Entity Data Model CUSTOMER Name Address City State Zip Code Telephone *Account Number

One-to-Many Relationship 1:m CUSTOMER Name Address City State Zip Code Telephone *Account Number ORDER *OrderNumber OrderDate PromiseDate

Many-to-Many Relationship (m:m) CUSTOMER Name Address City State Zip Code Telephone *Account Number ORDER *OrderNumber OrderDate PromiseDate PRODUCT *ProductNo Description UnitPrice Room Finish QtyOnHand ?

Many-to-Many Relationship (m:m) To depict the m:m relationship, a third entity is created forming two 1:m relationships This entity is known as an intersection entity or the junction table The vertical bar added to the “chicken foot” indicates the unique identifier is concatenated from ORDER and PRODUCT

Many-to-Many Relationship (m:m) An order has many requested items, but each requested item refers to only one order A product can be requested many times, but each requested item refers to only one product CUSTOMER Name Address City State Zip Code Telephone *Account Number ORDER *OrderNumber OrderDate PromiseDate PRODUCT *ProductNo Description UnitPrice Room Finish QtyOnHand REQUEST QtyOrdered LinePrice

Many-to-Many Relationship (m:m)

Many-to-Many Relationship (m:m) Foreign key Foreign keys Together they make up the primary key for this table Remember the primary keys and foreign keys must be the same data type and length

The final part of the ERDiagram The final part of the ERDiagram is the series of notations at the end of the lines. It is their appearance that gives rise to the name "Crow's Foot," which is what this kind of ERD is called. These lines indicate the nature of the relationship, which is called cardinality.

Cardinality Notation

Applying these interpretations In the relationship between Employee and Department, one or more employees belong to one department. In other words, each employee belongs to one and only one department, but each department has at least one and probably several employees in it. This is called a one-to-many relationship. In the relationship between Employee and Class we see that zero or more employees can take zero or more classes. In other words, a class could be taken by no one or by several employees. Similarly an employee could take zero classes or several classes. This is called a many-to-many relationship.

Applying these interpretations The relationships between Employee and Salaried Employee and between Employee and Hourly Employee are both one-to-one relationships. Each person in the Salaried Employee entity will have a corresponding record in the Employee entity. Also, each person in the Hourly Employee entity will have a corresponding record in the Employee entity. Since an employee will not be both hourly and salary, it is obvious that the Salaried Employee and Hourly Employee entities will each have fewer records than the Employee entity. For instance, there might be 1,000 employees, 700 of whom are hourly and 300 of whom are salaried. So when you see entities in a one-to-one relationship, it doesn't necessarily mean that they have the same number of records. It simply means that each record in the one entity has no more than one corresponding record in the other entity.

Try this: Scenario: Our database has authors who have an authorid, firstname, and lastname. These authors have many books, and the books have many authors. The books have a bookid, and a booktitle. Create the data model and show the relationships between the tables.

Answer: BOOKS *BookID AUTHORS BOOKTITLES *AuthorID BookTitle *AuthorID FName LName BOOKTITLES *AuthorID *BookID

Try this: Scenario: Languages spoken, an important (and likely a multivalued) attribute for a job candidate, deserves elevation to entity status in this database. The original creator of this customer's database had realized this and created a separate table for languages. The problem then became that, if each candidate can speak many languages and each language can be spoken by many candidates, there is a many-to-many relationship between the two tables. In the candidates entity we have a candidateid, salutation, fname, lname, address, and city. In the languages entity we have a language Create the data model and show the relationships between the tables.

Answer:

Try This: This database must track the members’ orders for merchandise. The info for each order must include the member who placed the order, amount paid, form of payment, order date, status of order, shipped date, products sold, and the quantity of each product.

Try This: This database must store information about the staff who work for the organization. The information must include the first names, last names, and middle initials, as well as the staff members’ addresses, phone numbers, and start dates. The information must also include their positions within the organization as well as who each one’s supervisor is.

Creating the relationships in Visio or MySQL Workbench In Visio or MySQL Workbench, it is only a drawing to depict how your relationship will look once you get it into mySQL. It does not have an physical impact on the data itself. Note: some of the newer programs allow you to directly import your data from their drawing program.

Steps In Building the Data Model While ER model lists and defines the constructs required to build a data model, there is no standard process for doing so. Typically, the entities and relationships are modeled first, followed by key attributes, and then the model is finished by adding non-key attributes. The sequence used for this course are: Identification of data objects and relationships Drafting the initial ER diagram with entities and relationships Refining the ER diagram Add key attributes to the diagram Adding non-key attributes Validating the model through normalization Adding integrity rules to the Model

Questions?