Entity Relationship (E-R) Modeling Hachim Haddouti

Slides:



Advertisements
Similar presentations
Chapter # 4 BIS Database Systems
Advertisements

Entity Relationship (E-R) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Entity Relationship (ER) Modeling
Chapter 4 Entity Relationship (E-R) Modeling
Entity Relationship (ER) Modeling
Chapter 4 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.
Chapter 4 Entity Relationship (E-R) Modeling
Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
Systems Development Life Cycle
Entity Relationship (E-R) Modeling
LIS 557 Database Design and Management William Voon Michael Cole Spring '04.
Chapter 2 Data Models Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
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
Chapter 4 Entity Relationship (E-R) Modeling
Data Modeling 1 Yong Choi School of Business CSUB.
Data Modeling 1 Yong Choi School of Business CSUB.
Yong Choi School of Business CSUB
Chapter 4 Entity Relationship (E-R) Modeling
Data Modeling Using the Entity-Relationship Model
2 1 Chapter 2 Data Model Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
3 Chapter 3 Entity Relationship (E-R) Modeling Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
1. 2 Data Modeling 3 Process of creating a logical representation of the structure of the database The most important task in database development E-R.
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
ITEC 3220M Using and Designing Database Systems Instructor: Prof. Z.Yang Course Website: 3220m.htm
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Chapter 5 Entity Relationship (ER) Modelling
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
9/10/2012ISC 329 Isabelle Bichindaritz1 Entity Relationship (E-R) Modeling.
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
© 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 
4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Relationship Degree Indicates number of entities or participants.
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.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
1 A Demo of Logical Database Design. 2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational model.
3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
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.
Entity Relationship Modeling
Database Design – Lecture 4 Conceptual Data Modeling.
Entity-Relation Model. E-R Model The Entity-Relationship (ER) model was originally proposed by Peter in 1976 ER model is a conceptual data model that.
Data Modeling Yong Choi School of Business CSUB. Part # 2 2 Study Objectives Understand concepts of data modeling and its purpose Learn how relationships.
1 Database Systems Entity Relationship (E-R) Modeling.
The Entity-Relationship Model, P. I R. Nakatsu. Data Modeling A data model is the relatively simple representation, usually graphic, of the structure.
Chapter 4 Entity Relationship (E-R) Modeling
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
Entity Relationship Modeling
Entity Relationship (E-R) Model
TMC2034 Database Concept and Design
Entity Relationship (E-R) Modeling
Entity Relationship (E-R) Modeling
Tables and Their Characteristics
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Review of Week 1 Database DBMS File systems vs. database systems
Chapter 4 Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
Chapter # 4 Entity Relationship (ER) Modeling.
Presentation transcript:

Entity Relationship (E-R) Modeling Hachim Haddouti Chapter 3 Entity Relationship (E-R) Modeling Hachim Haddouti

In this chapter, you will learn: What a conceptual model is and what its purpose is The difference between internal and external models How internal and external models serve the database design process How relationships between entities are defined and refined, and how such relationships are incorporated into the database design process How ERD components affect database design and implementation How to interpret the modeling symbols for the four most popular E-R modeling tools That real-world database design often requires you to reconcile conflicting goals Hachim Haddouti, CH3, see also Rob & Coronel

Hachim Haddouti, CH3, see also Rob & Coronel Why Data Modeling Database designers, programmers and end users have different views of the data Data modeling abstracts real-world complexities to facilitate communication between designers, programmers and end users A data model is a relatively simple, usually graphic representation of real-world data structures, their characteristics, constraints, relations and transformations It is necessary for good database design and, hence, good applications Hachim Haddouti, CH3, see also Rob & Coronel

Data Models: Degrees of Data Abstraction Hachim Haddouti, CH3, see also Rob & Coronel

Degrees of Abstraction Conceptual Global view of data Basis for identification and description of main data items ERD used to represent conceptual data model Hardware and software independent Internal Representation of database as seen by DBMS Adapts conceptual model to specific DBMS Software dependent Hachim Haddouti, CH3, see also Rob & Coronel

Degrees of Abstraction (con’t.) External Users’ views of data environment (functional modules) Provides subsets of internal view (student registration, class scheduling) Makes application program development easier Facilitates designers’ tasks Ensures adequacy of conceptual model Ensures security constraints in design Physical Lowest level of abstraction Software and hardware dependent Requires definition of physical storage devices and access methods Hachim Haddouti, CH3, see also Rob & Coronel

The Entity Relationship (E-R) Model E-R Model: graphical data representation Represents conceptual view Main Components Entities (real world objects) Corresponds to entire table, not row Represented by rectangle E.g. PERSON, PLACE, BOOK, CAR, EMPLOYEE An entity set is a set of entities of the same type that share the same properties. E.g: set of all persons, companies, trees, holidays Attributes Relationships Complementary of Relational Model ( an entity corresponds to a relational table, an entity occurrence to a row) Hachim Haddouti, CH3, see also Rob & Coronel

Hachim Haddouti, CH3, see also Rob & Coronel Attributes Characteristics of entities Domain is set of possible values, e.g. GPA(0,4) Primary keys underlined Hachim Haddouti, CH3, see also Rob & Coronel

Hachim Haddouti, CH3, see also Rob & Coronel Attributes (con’t.) Simple Cannot be subdivided Age, sex, marital status Composite Can be subdivided into additional attributes Address into street, city, zip Single-valued Can have only a single value Person has one social security number Multi-valued Can have many values Person may have several college degrees, phone numbers Implementation!!! Derived Can be derived with algorithm Age can be derived from date of birth Hachim Haddouti, CH3, see also Rob & Coronel

Hachim Haddouti, CH3, see also Rob & Coronel Relationships Association between entities Connected entities are called participants Operate in both directions Connectivity describes relationship classification 1:1, 1:M, M:N Cardinality Expresses number of entity occurrences/instances associated with one occurrence of related entity Hachim Haddouti, CH3, see also Rob & Coronel

Connectivity and Cardinality in an ERD (business rules) Hachim Haddouti, CH3, see also Rob & Coronel

Relationship Strength Existence dependence Entity’s existence depends on existence of related entities EMPLOYEE claims DEPENDENT Weak relationship (non-identifying) One entity is existence-independent on another PK of related entity doesn’t contain PK component of parent entity Strong relationship (identifying) One entity is existence-dependent on another PK of related entity contains PK component of parent entity Hachim Haddouti, CH3, see also Rob & Coronel

Relationship Participation Optional Entity occurrence does not require a corresponding occurrence in related entity Shown by drawing a small circle on side of optional entity on ERD E.g. INVOICE is optional to CUSTOMER, or INVOICE and PRODUCT Mandatory Entity occurrence requires corresponding occurrence in related entity If no optionality symbol is shown on ERD, it is mandatory Hachim Haddouti, CH3, see also Rob & Coronel

Example of Optional Entitites Hachim Haddouti, CH3, see also Rob & Coronel

Hachim Haddouti, CH3, see also Rob & Coronel Weak Entity Existence-dependent on another entity Has primary key that is partially or totally derived from parent entity Hachim Haddouti, CH3, see also Rob & Coronel

Hachim Haddouti, CH3, see also Rob & Coronel Relationship Degree Indicates number of associated entities Unary Single entity Recursive Exists between occurrences of same entity set Binary Two entities associated Ternary Three entities associated Hachim Haddouti, CH3, see also Rob & Coronel

Three Types of Relationships Hachim Haddouti, CH3, see also Rob & Coronel

Hachim Haddouti, CH3, see also Rob & Coronel Composite Entities Used to ‘bridge’ between M:N relationships Bridge entities composed of primary keys of each entity needing connection Hachim Haddouti, CH3, see also Rob & Coronel

Hachim Haddouti, CH3, see also Rob & Coronel Bridge Entity Hachim Haddouti, CH3, see also Rob & Coronel

Entity Supertypes and Subtypes Generalization hierarchy Depicts relationships between higher-level supertype and lower-level subtype entities Supertype has shared attributes Subtypes have unique attributes Disjoint relationships Unique subtypes Non-overlapping Indicated with a ‘G’ Overlapping subtypes use ‘Gs’ Symbol Hachim Haddouti, CH3, see also Rob & Coronel

Generalization Hierarchy with Overlapping Subtypes Hachim Haddouti, CH3, see also Rob & Coronel

Comparison of E-R Modeling Symbols Alternate styles developed to enable easier use of CASE tools Chen Moved conceptual design into practical database design arena Crow’s Foot Cannot detail all cardinalities Rein85 Similar to Crow’s Foot Operates at higher level of abstraction IDEF1X Derivative of ICAM studies in the late 1970’s Uses fewer symbols Hachim Haddouti, CH3, see also Rob & Coronel

Comparison of E-R Modeling Symbols Hachim Haddouti, CH3, see also Rob & Coronel

Challenge of Database Design: Conflicting Goals Database must be designed to conform to design standards High-speed processing may require design compromises Quest for timely information may be the focus of database design Other concerns Security Performance Shared access Integrity Hachim Haddouti, CH3, see also Rob & Coronel

Entity-Relationship Model Example of schema in the entity-relationship model Hachim Haddouti, CH3, see also Rob & Coronel

A Sample Relational Database Hachim Haddouti, CH3, see also Rob & Coronel

E-R Diagram for Insurance Hachim Haddouti, CH3, see also Rob & Coronel

Draw ERD for Ifrane School The Ifrane School (IS) has contacted you to create a conceptual model whose application will meet the expected database requirements for its training program. Those are their business rules: IS has 12 instructors and can handle up to 30 trainees per class. IS offers five "advanced technology" courses, each of which may generate several classes. If a class has fewer than 10 trainees in it, it will be canceled. It is, therefore, possible for a course not to generate any classes during a session. Each class is taught by one instructor. Each instructor may teach up to two classes or may be assigned to do research. Each trainee may take up to two classes per session. Hachim Haddouti, CH3, see also Rob & Coronel

Interpretation of IS biz Rules Basically, 3 sets of relationships exist: A COURSE may generate one or more CLASSes, an INSTRUCTOR teaches up to two CLASSes, and a TRAINEE may enroll in up to two CLASSes. A trainee can take more than one class, and each class contains many (10 or more) trainees, so there is a M:N relationship between TRAINEE and CLASS. A class is taught by only one instructor, but an instructor can teach up to two classes. Therefore, there is a 1:M relationship between INSTRUCTOR and CLASS. Finally, a COURSE may generate more than one CLASS, while each CLASS is based on one COURSE, so there is a 1:M relationship between COURSE and CLASS. Note the optional and mandatory relationships: a CLASS must have TRAINEEs enrolled in it, but TRAINEEs do not necessarily take CLASSes. (Some may take "on the job training.") An INSTRUCTOR may not be teaching any CLASSes, doing research instead, but each CLASS must have an INSTRUCTOR. If not enough people sign up for a CLASS, a COURSE may not generate any CLASSes, but each CLASS must represent a COURSE. Hachim Haddouti, CH3, see also Rob & Coronel

Hachim Haddouti, CH3, see also Rob & Coronel ERD for Ifrane School Hachim Haddouti, CH3, see also Rob & Coronel