CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.

Slides:



Advertisements
Similar presentations
Chapter 6: Entity-Relationship Model (part I)
Advertisements

Chapter 31 Chapter 3 Data Modeling Using the Entity-Relationship Model.
Systems Development Life Cycle
Text-Book Chapters (7 and 8) Entity-Relationship Model
CS157A Lecture 3 ER Diagram Prof. Sin-Min Lee Department of Computer Science San Jose State University.
Databases Revision.
Entity-Relationship Data Model CS 157A Professor Sin-Min Lee Student: Yen-Chu Pan.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Modeling Data The Entity Relationship Model (ER) For Database Design.
1–1 The E-R Model Prof. Sin-Min Lee Department of Computer Science.
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.
ENTITY RELATIONSHIP DATA MODEL ELIZABETH GEORGE. INTRODUCTION Architect Aeronautical engineers Computer architects Traffic engineers.
Chapter 2: Entity-Relationship Model (Continued)
Class Number – CS 304 Class Name - DBMS Instructor – Sanjay Madria Instructor – Sanjay Madria Lesson Title – ER Model.
CS 405G Introduction to Database Systems
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
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Chapter 3 Data Modeling Using the Entity-Relationship (ER) Model.
the Entity-Relationship Model
Dr. Mohamed Osman Hegaz1 Conceptual data base design: The conceptual models: The Entity Relationship Model.
Outline What is ER Model? And Why? Example COMPANY Database
Entity-Relationship Model. 2 Outline  What is ER Model? And Why?  Overview of Database Design Process  Example COMPANY Database  ER Model Concepts.
Database System Concepts, 5th Ed. Chapter 6: Entity-Relationship Model.
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Chapter 7 Database Design and The E–R Model. 2 Goals n Facilitate DB design and represent the overall logical structure of the DB. n Definition Entities.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Entity-Relationship.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Entity-Relationship Model Using High-Level Conceptual Data Models for Database Design Entity Types, Sets, Attributes and Keys Relationship Types, Sets,
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:
Chapter 11 & 12 Entity-Relationship (E-R) Model Characteristics of E-R Model Components of E-R Model Example of E-R Model Enhanced E-R Model.
Computing & Information Sciences Kansas State University Wednesday, 24 Sep 2008CIS 560: Database System Concepts Lecture 12 of 42 Wednesday, 24 September.
CS 405G: Introduction to Database Systems Lecture 2 : Database Design I.
Chapter 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
Database Management Systems MIT Lesson 02 – Database Design (Entity Relationship Diagram) By S. Sabraz Nawaz.
ITTelkom Entity Relationship Diagram (1) CS2343 Perancangan Basisdata Relasional.
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan Lecture-03 Introduction –Data Models Lectured by, Jesmin Akhter.
Databases Illuminated Chapter 3 The Entity Relationship Model.
Entity-Relationship Model Chapter 3 II COSC 457 Sungchul Hong.
Data Modeling Using the Entity-Relationship (ER) Data Model (Based on Chapter 3 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 3)
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Slide 3- 1.
Computing & Information Sciences Kansas State University Friday, 26 Sep 2008CIS 560: Database System Concepts Lecture 13 of 42 Friday, 26 September 2008.
Database and Information Retrieval System
Database Systems – ER Diagrams EXAMPLE COMPANY DATABASE Requirements of the Company (oversimplified to illustrate) The company is organized into DEPARTMENTs.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Data Modeling Using the Entity-Relationship (ER) Data Model.
Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 3: Data Modeling Using the Entity-Relationship (ER) Data Model
The Entity-Relationship Model, P. I R. Nakatsu. Data Modeling A data model is the relatively simple representation, usually graphic, of the structure.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
Chapter 2: Entity-Relationship Model. 3.2 Chapter 2: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts - 6 th Edition Chapter 7: Entity-Relationship Model.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Entity-Relationship.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Entity-Relationship Data Model
Data Modeling Using the Entity- Relationship (ER) Model
Entity-Relationship Model
Entity-Relationship Model
Entity Relationship Model
Entity-Relationship Model
Chapter 7: Entity-Relationship Model
Entity Relation Model Tingting Zhang.
Entity-Relationship Data Model
Presentation transcript:

CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University

CSE 412/598Entity Relationship2 ENTITY-RELATIONSHIP Conceptual Model Graphical representation of the overall (logical) structure of a database, which is independent of the DBMS in which the database is implemented. Entity Typean object that exists and is distinguishable from other objects (e.g., students); represented by a set of attributes (e.g., student-id, name, major) Entity Extension set of entities of the same type (e.g., instances of students); entity sets need not be disjoint (e.g., person & customer) Relationship Type an association among several entities (e.g., students taking classes) Relationship Instance a set of relationships of the same type (e.g., the instances of which students are taking what classes)

CSE 412/598Entity Relationship3 DIAGRAM entity type attribute composite attribute relationship type links Single-valued multivalued derived

CSE 412/598Entity Relationship4 MAPPING CARDINALITIES Mapping cardinalities express the number of entities to which another entity can be associated via a relationship. For a binary relationship set, there are several cardinality ratios: 1:1 (one-to-one) 1:N (one-to-many) N:1 (many-to-one) M:N (many-to-many) The following examples of cardinality ratios are expressed using the abstract entity sets A and B.

CSE 412/598Entity Relationship5 CARDINALITY RATIOS 1:1 1:1An entity in A is associated with at most one entity in B. An entity in B is associated with at most one entity in A.

CSE 412/598Entity Relationship6 CARDINALITY RATIOS 1:N 1:NAn entity in A is associated with any number of entities in B. An entity in B is associated with at most one entity in A.

CSE 412/598Entity Relationship7 CARDINALITY RATIOS M:N M:NAn entity in A is associated with any number of entities in B. An entity in B is associated with any number of entities in A.

CSE 412/598Entity Relationship8 1:1 RELATIONSHIP Example Assumption:Each department has at most one manager and a manager is the head of at most one department.

CSE 412/598Entity Relationship9 1:N RELATIONSHIP Example Assumption:Each course is taught by one teacher but a teacher can teach many courses.

CSE 412/598Entity Relationship10 M:N RELATIONSHIP Example Assumption:A country exports more than one product and products can be exported by more than one country.

CSE 412/598Entity Relationship11 STRUCTURAL CONSTRAINT Cardinality Ratio determines the number of relationship instances that an entity participates in for a given relationship type, e.g., 1:1, 1:N, M:N Participation Constraint determines the existence dependence of an entity on its participation in a relationship instance total:e.g., an employee must work in a department (denoted by a double edge on ER diagram) partial:e.g., an employee may be a manager (denoted by a single edge on ER diagram)

CSE 412/598Entity Relationship12 MIN/MAX PAIRS To add more meaning (semantics), associate a (min,max) pair with an entity type E in relationship type R 0= =1 An entity e in E must participate in at least min and at most max relationship instances in R at all times. min = 0 :partial participation min > 0 :total participation

CSE 412/598Entity Relationship13 MIN/MAX EXAMPLE An employee need not be a manager but if a manager, manages exactly one department. A department must have exactly one manager. An employee works in exactly one department. A department must have at least one employee, but many employees can work in a department.

CSE 412/598Entity Relationship14 KEYS Since an entity is distinguishable from other objects, we need to specify a key, which is a set of attributes for an entity type that uniquely identifies an instance of that entity type. SuperkeyA set of one or more attributes, which, taken collectively, allow the unique identification of an entity in its entity type (e.g., {id}, {id name} ). A superkey may contain extra attributes. Candidate Key A superkey for which no proper subset is a superkey (e.g. {id}, {name address}). Primary Key A candidate key that is chosen by the DBA as the principal means of identifying entities. On an ER diagram, we underline the attribute that is the candidate key for that entity.

CSE 412/598Entity Relationship15 STRONG vs. WEAK ENTITIES Strong Entity:an entity that has a primary key Weak Entity:an entity that does not have sufficient attributes to form a primary key Consider as an example a dependent entity type with attributes firstname, birthdate and sex. Each dependent is unique for a given employee but different employees may have dependents with the same name and birthdate. The primary key of a weak entity type is formed by the primary key of the entity on which it is existence dependent plus its discriminator (partial key), which is a set of attributes that distinguishes the entities in a weak entity set that depend on its identifying owner. dependent's primary key: {empid, firstname, birthdate}

CSE 412/598Entity Relationship16 WEAK ENTITY EXAMPLE

CSE 412/598Entity Relationship17 WEAK ENTITY Notation and Terminology Weak Entity w Identifying Relationship i Identifying Owner o Existence Dependent w i o

CSE 412/598Entity Relationship18 ER EXERCISE Consider a large company that wants to keep track of the training courses that its employees have taken. An employee has a name, identification number and salary. An employee works in at most one department. A department has a unique number, a name and the identification number of the manager of that department. An employee can take many training courses but can take a given course at most once. Each course is identified by a course number, descriptive name, its instructor and its length in hours. Since a particular course may be offered several times, the date that an employee takes a course is also recorded. Give an ER diagram to represent this enterprise.

CSE 412/598Entity Relationship19 ER DIAGRAM Your solutionClass solution

CSE 412/598Entity Relationship20 RECURSIVE RELATIONSHIPS

CSE 412/598Entity Relationship21 NON-BINARY RELATIONSHIPS