Copyright © 1998-2011 Curt Hill Entities and Relationships The basics and what they have to do with database.

Slides:



Advertisements
Similar presentations
Conceptual Design using the Entity-Relationship Model
Advertisements

the Entity-Relationship (ER) Model
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Entity Relationship (E-R) Modeling Hachim Haddouti
1 Database Theoretic Basis Entity Relationship (E-R) Modeling Database Theoretic Basis Entity Relationship (E-R) Modeling.
Entity Relationship (ER) Modeling
The Entity-Relationship (ER) Model
The Entity-Relationship Model
The Entity-Relationship Model Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY courtesy of Joe Hellerstein for some slides.
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Entity Relationship (ER) Modeling
Entity Relationship (E-R) Modeling
LIS 557 Database Design and Management William Voon Michael Cole Spring '04.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke Database Processing Tenth Edition Chapter 5 Data.
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Week 3 Outline Overview of Database Design Process Example Database Application (COMPANY) ER Model.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
Chapter Five Data Modeling with the Entity-Relationship Model.
CSCI 242 Relational Data Modeling Copyright 2011, David C. Roberts, all rights reserved.
APPENDIX C DESIGNING DATABASES
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
Data Modeling Using the Entity-Relationship Model
Data Modeling Using the Entity-Relationship Model
3 Chapter 3 Entity Relationship (E-R) Modeling Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 7.1.
Daniel AdinugrohoDatabase Programming 1 DATABASE PROGRAMMING Lecture on 29 – 04 – 2005.
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
Chapter 4 The Relational Model.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
ICS 321 Spring 2011 High Level Database Models Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 2/7/20111Lipyeow.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright © Curt Hill The Relational Model of Database Basic organization and terms.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Entity-Relationship Model Using High-Level Conceptual Data Models for Database Design Entity Types, Sets, Attributes and Keys Relationship Types, Sets,
Entity Relationship Diagram. Introduction Definition: Entity-relationship diagram is a data-modeling technique that visualises entities, the attributes.
 Entity-relationship models (ERM) Entity-relationship models (ERM)  Simple E-R Diagram Simple E-R Diagram  Weak Entity Weak Entity  Strong Entity.
Entity-Relationship Model
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Databases Illuminated Chapter 3 The Entity Relationship Model.
Copyright © Curt Hill Components and Artifacts Data and Information.
advanced data modeling
The Entity-Relationship (ER) Model. Overview of db design Requirement analysis – Data to be stored – Applications to be built – Operations (most frequent)
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Data Modeling Using the Entity-Relationship (ER) Data Model.
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
1 Database Systems Entity Relationship (E-R) Modeling.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
LECTURE 1: Entity Relationship MODEL. Think before doing it! Like most of the software projects, you need to think before you do something. Before developing.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
The Relational Model Lecture #2 Monday 21 st October 2001.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
MBI 630: Week 9 Conceptual Data Modeling and Designing Database 6/10/2016.
ENTITY- RELATIONSHIP MODELLING 1 All rights reserved by
Topic 3: ER – Entity Relationship Model (ERM) 6/12/
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
IT 5433 LM2 ER & EER Model. Learning Objectives: Explain importance of data modeling Define and use the entity-relationship model Define E/R terms Describe.
1 The Relational Data Model David J. Stucki. Relational Model Concepts 2 Fundamental concept: the relation  The Relational Model represents an entire.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
COP Introduction to Database Structures
CS4222 Principles of Database System
Tables and Their Characteristics
Database Design – Lecture 4
Databases and Database Management Systems Chapter 9
Translation of ER-diagram into Relational Schema
Chapter 4 Entity Relationship (ER) Modeling
ER MODELING Instructor: SAMIA ARSHAD
Entity Relationship (ER) Modeling
Presentation transcript:

Copyright © Curt Hill Entities and Relationships The basics and what they have to do with database

Copyright © Curt Hill Entities and Relationships Entity –Usually a real world thing College: faculty, course, students –Each entity has attributes People have names, ages Courses have names, hours, times Relationship –A logical connection between two or more entities –These may have attributes

Copyright © Curt Hill Relationships In mathematics a relation is an represented by an ordered n-tuple Each record is an ordered n-tuple –Every table expresses relationship –Table is a file with just one record type Relationships may span tables

Copyright © Curt Hill Relationship Arity or Cardinality How many are on either side of the relationship One to one –A person and SSN –Keys need this arity One to many –Instructor to student in a course Many to many –People to organizations –Hardest to represent

Copyright © Curt Hill Table Use We use a table to collect a group of entities of the same type –The student table The attributes of the relationship form the fields of a record One to one relationships are just a field in the table One to many relationships and many to many relationships are often their own table

Copyright © Curt Hill ER Model The Entity-Relationship model helps us to think about and design a database The only data in a database consists of entities, relationships and their attributes Helps us to bridge the gap between informal user desires to a formal database design

Copyright © Curt Hill Entity-Relationship Diagrams A pictorial mechanism to show what is going on Not standardized –They come in many variations Entities – rectangles Attributes – ovals Relationships – diamonds Connections – lines

Copyright © Curt Hill A simplified ER diagram Licenses Manufacturer Dealer Car Shipper Builds Stocks Contracts Transports

Copyright © Curt Hill A manufacturing ER diagram Last one had no attributes for several reasons Often that is how we get started –Refine as we go along These tend to be both formal and informal The graphic had no space

Copyright © Curt Hill ER diagram Again Licenses Manufacturer Dealer Name Address Type StartDate Address Fee Name MID Lines DID LID

Copyright © Curt Hill Legend on the above Two perpendicular lines indicate an arity of one Terminating with three lines indicates an arity of many Underlined name indicates key –There may be more than one Relationships do not have to be between just two different types of entities –Binary, ternary, n-ary –One or more different tables

Variants The above diagram is often called Crow’s Foot diagram –The arity relationship is done using crow’s feet or perpendicular lines The alternative is called Chen notation –This must 1,n,m to identify Copyright © Curt Hill

ER diagram Again Licenses Manufacturer Dealer Name Address Type StartDate Address Fee Name MID Lines DID LID 1 M

Copyright © Curt Hill Key Constraints Another way to consider the arity issue is with key constraints Suppose a dealer is only allowed one license –We would denote that uniqueness property with an arrow from dealers to the license relationship –This gives us the next screen

Copyright © Curt Hill ER diagram Again Licenses Manufacturer Dealer Name Address Type StartDate Address Fee Name MID Lines DID LID

Copyright © Curt Hill Participation Constraints Total: every record in the table participates in this relationship –All manufacturers have dealers –Usually a heavy line Partial: there may be some records without this relationship –Suppose dealers includes used car dealers –Some have no license from a manufacturer –Denoted by a light line

Copyright © Curt Hill ER diagram Again Licenses Manufacturer Dealer Name Address Type StartDate Address Fee Name MID Lines DID LID

Copyright © Curt Hill Some Definitions Entity set –Any set of similar entities –Could be a whole table or subset of this table’s records Relationship set

Copyright © Curt Hill Steps for DB Design Requirements Conceptual Logical Schema Refinement Physical Design Application Security

Copyright © Curt Hill Requirements What to find –What data is needed –What applications will be needed How to go about it –Interview the staff –Study any prior systems

Copyright © Curt Hill Conceptual When the requirements are understood, then take a shot at the high level design This is a high level approach A simple model is required since it must be understood by non- technical personnel

Copyright © Curt Hill Logical Choose a DBMS Translate conceptual design into a schema supportable by the DBMS –Table definitions –Relationships –Primary and foreign keys

Copyright © Curt Hill Schema Refinement It is never perfect the first time Put the tables in the desired normal form There are objective techniques to drive the process

Copyright © Curt Hill Physical Design Performance is the key in this step What expected usage will be Where to use indexing or other performance enhancements or re- factor the tables

Copyright © Curt Hill Applications The requirements of the applications that interface with the database cause the last refinement These applications may interface with the web as well

Copyright © Curt Hill Security Tailoring the views with security in mind