Entity-Relationship Model & Diagram

Slides:



Advertisements
Similar presentations
Entity Relationship Diagrams
Advertisements

Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Systems Development Life Cycle
Text-Book Chapters (7 and 8) Entity-Relationship Model
Modeling the Data: Conceptual and Logical Data Modeling
Agenda for Week 1/31 & 2/2 Learn about database design
1–1 The E-R Model Prof. Sin-Min Lee Department of Computer Science.
IST Databases and DBMSs Todd S. Bacastow January 2005.
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Conceptual Data Modeling, Entity Relationship Diagrams
Concepts and Terminology Introduction to Database.
Chapter 2 Data Models Database Systems: Design, Implementation, and Management, Rob and Coronel Adapted for INFS-3200.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 1 © Akhilesh Bajaj, 2000, 2002, 2003, 2004.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T5: Designing Database Applications Business Driven Technology.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
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:
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Databases Illuminated Chapter 3 The Entity Relationship Model.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
McGraw-Hill/Irwin Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Modeling the Data: Conceptual and Logical Data Modeling.
The Relational Model Lecture #2 Monday 21 st October 2001.
Entity Relationship Diagram ERD. Background Peter Chen developed ERDs in Charles Bachman and James Martin have added some slight refinements to.
Distribution of Marks For Second Semester Internal Sessional Evaluation External Evaluation Assignment /Project QuizzesClass Attendance Mid-Term Test Total.
Chapter 2: Entity-Relationship Model
Entity Relationship (E-R) Model
Data Modeling Using the Entity- Relationship (ER) Model
COP Introduction to Database Structures
Contents Design Process Modeling Constraints E-R Diagram Design Issues
Comp 1100 Entity-Relationship (ER) Model
Databases and DBMSs Todd S. Bacastow January
Data Modeling Using the ERD
Entity-Relationship Model
Entity Relationship Diagram
ER model Ashima Wadhwa.
Entity-Relationship Model
Entity Relationship Model
© The McGraw-Hill Companies, All Rights Reserved APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
DESIGNING DATABASE APPLICATIONS
Entity-Relationship Model
Chapter 2: Entity-Relationship Model
Chapter 7: Entity-Relationship Model
Entity-Relationship Modelling
Chapter 7 Entity-Relationship Model
Outline of the ER Model By S.Saha
Entity-Relationship Modeling
ER MODEL Lecture 3.
Entity-Relationship Model and Diagrams (continued)
CS 174: Server-Side Web Programming February 12 Class Meeting
Overview of Entity‐Relationship Model
Entity Relationship Diagrams
Entity-Relationship Model
Entity-Relationship Modelling
MIS2502: Data Analytics Relational Data Modeling
Entity Relationship Model
Database Modeling using Entity Relationship Model (E-R Model)
Review of Week 1 Database DBMS File systems vs. database systems
CHAPTER 2 - Database Requirements and ER Modeling
Chapter 7: Entity-Relationship Model
Entity-Relationship Diagram (ERD)
INSTRUCTOR: MRS T.G. ZHOU
MIS2502: Data Analytics Relational Data Modeling 2
Entity Relation Model Tingting Zhang.
ER MODELING Instructor: SAMIA ARSHAD
Presentation transcript:

Entity-Relationship Model & Diagram Todd S. Bacastow IST 210: Organization of data 2/24/2019

Design Principles The client has some vague idea of what he/she wants. YOUR task is to design a DB that represents these thoughts and only these thoughts. 2/24/2019

Data Modeling Data modeling is a formalism Entity-Relationship Model (ER) Entity Relationship model: a visual model attempts to capture the structure of data 2/24/2019

What is Visual Modeling? Business Process Order Item Ship via Computer System Visual Modeling is modeling using standard graphical notations Core Message: Modeling captures essential parts of the system Key Point 1: Computer system basically automate business processes. However, it’s not easy to build software systems on time and within budget. Key Point 2: Building a complex software system requires blueprint. You don’t construct a building without a blueprint. Visual modeling is the blueprint for software systems. Conclusion: VM is a key to successful software development 2/24/2019 3

Visual Modeling is a Communication Tool Use visual modeling to capture business objects and logic Core Message: VM is a communication tool. Key Point 1: Business analyst and domain experts define requirements. Software architects and developers build systems based on requirements. Typically, they have communication problems due to different use of terminology and different definition of concepts. Key Point 2: Take a look at the Rose development team. The team is distributed in three cities around the world; Sweden, Milwaukee, and Philadelphia. There is a common language - visual modeling. Key Point 3: With VM, there is a smooth transition between business domain and computer domain. Also, you can establish traceability from business domain to computer domain. Conclusion: VM is a communication tool. Use visual modeling to analyze and design your database 2/24/2019 Copyright © 1997 by Rational Software Corporation 5

Entity-Relationship (E-R) Modeling Premises The real world consists of entities Entities in one enterprise are related Database model = relevant entities + relationships among them Entities and relationships have attributes 2/24/2019

E-R Features Basic Concepts Relatively easy to model real-world Translates easily to relational data model Basic Concepts Entity sets Relationship sets Attributes 2/24/2019

Entities Definition Entity Entity set an object that is distinguishable from other objects. a particular student, a particular book Entity set a set of entities of the same type that share the same set of properties students, books 2/24/2019

Entities Examples of these entity types are: Person: employee student customer supplier 2/24/2019

Entity Types Place: Object: city state county vehicle building airplane animal 2/24/2019

Entity Types Event: Concept: purchase sale registration game account course work group department 2/24/2019

Weak Entities Weak entities are entities, but with a difference--- Weak entities only exist because some other entity exists. For example: two entities employee and salary-history salary-history is a weak entity the record of an employee’s salary history could only exist if a record of an employee also exists E.g., Joe Smith’s salary history wouldn’t make much sense if Joe Smith doesn’t exist in the data base. 2/24/2019

Finding Entities Entities are normally located through the various user views identified during analysis Search for entities by: looking for nouns finding objects/things that have many instances (i.e., things stored in tables) have descriptive/defining properties (attributes) 2/24/2019

Attributes Definition: Attribute: a descriptive property possessed by all members of an entity set. Attribute set: the set of all attributes possessed by members of an entity set. e.g., book = (author,title,publisher,barcode, etc.) e.g., student = (ID,surname,firstname,course, etc.) e.g., subject = (code,name,lecturer,timetable, etc.) 2/24/2019

Attributes Properties of Attributes Domain - the seat of permitted values for each attribute Type: data type simple vs. composite attributes single-valued vs. multivalued derived vs. stored 2/24/2019

Simple & Composite Attributes Simple attributes cannot be decomposed without loss of meaning, e.g., Title: Mr., Ms., Mrs., Dr. Composite attributes can be further decomposed without loss of meaning, e.g., Name: first name + last name Date: day + month + year Address: street + city + state + zip 2/24/2019

Single-Valued Attributes Single-valued attributes occur once only for each entity instance, e.g. ID Name Department 2/24/2019

Multi-Valued Attributes Multi-valued attributes can occur more than once for the same entity instance; e.g. Sports person plays Hobbies person likes Skills person has achieved Courses person has taken Degrees person completed 2/24/2019

Stored & Derived Attributes A derived attribute is one that can be calculated from other stored data not usually stored as an attribute occasionally stored to speed information/query requests when these occur frequently Maybe shown on ERD as attribute name within a dashed-line ellipse 2/24/2019

Relationships Relationship: an association among 2 or more entities E1: student - R: takes - E2: subject e.g. Sara Smith takes IST210 2/24/2019

Relationship sets Relationship set: a relation among entity sets: e.g. (Smith,IST210) takes Relationship sets have degree may have attributes e.g. final mark attribute for takes relationship 2/24/2019

E-R Diagram Entity Relationship 2/24/2019

Entity Relationship Diagram Symbols The symbols used in an ERD are not standardised so - diagrams may appear somewhat different depending upon who created them symbols used for our purposes will follow the format 2/24/2019

Graphical Elements of the ER Diagram Its components are: rectangles representing entity sets. ellipses representing attributes. diamonds representing relationship sets. Relationship Customer Account Entity Customers Accounts Attribute id name 2/24/2019

Basic Symbols 2/24/2019

Relationship STUDENT COURSE Connect two or more entity sets Take COURSE Connect two or more entity sets Represented by diamonds Think of the “value” of a relationship set as a table One row for each list of entities, one from each set, that are connected by the relationship 2/24/2019

Finding Relationships Often represented by a Verb allows answers to questions not available through individual entity types EMPLOYEE Has DEPENDENT Weak Entity 2/24/2019

Attributes & Relationships Relationship can have 1 or more attributes depend on relationship do not belong to the entities for example the date on which a course was completed belongs to the relationship rather than either of the participating entities shown in same way as entity attributes 2/24/2019

Multiplicity or Cardinality 2/24/2019

Cardinality Symbology 2/24/2019

One-to-One 2/24/2019

One-to-Many 2/24/2019

Many-to-Many 2/24/2019

Recursive 2/24/2019

Common Constraints Keys  we will discuss next Single-value constraints  must have a certain value Null value Referential integrity constraints  “broken link to a web page” Domain constraints  a negative account balance General constraints  limits you set 2/24/2019

Keys Student Class ID Last First Grade Class Name #Stud Instructor Primary key Foreign key Primary key Student Class ID Last First Grade Class Name #Stud Instructor 1 Wood Bob C Ist 357 2 Kent Chuck B Ist 115 3 Smith Jane A Ist 357 4 Boone Dan B Ist 357 Ist 357 48 Jones Ist 115 120 Brower Ist 20 120 Mennis 2/24/2019

Keys A key is a set of attributes whose values can belong to at most one entity In E-R model, every E.S. must have a key More than one key: a set of attributes is the “designated” key In E-R diagrams: underline all attributed of the designated key 2/24/2019

A Multi-attribute Key dept+number (e.g. IST 210) form a key for courses. Possibly, hours+room also forms a key. But we have not designated it as such. 2/24/2019

Weak Entities & Keys Weak entity sets: Does not have a primary key are meaningful only in the context of a relationship with an owning strong entity set 2/24/2019

We Made it! 2/24/2019