Entity-Relationship Model Ch. 3

Slides:



Advertisements
Similar presentations
Database Design The process of finding user requirement
Advertisements

the Entity-Relationship (ER) Model
The Entity-Relationship (ER) Model
Chapter 31 Chapter 3 Data Modeling Using the Entity-Relationship Model.
The Entity-Relationship Model Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY courtesy of Joe Hellerstein for some slides.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Entity-Relationship Model Chapter 2.
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
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.
The Entity-Relationship (ER) Model CS541 Computer Science Department Rutgers University.
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
Chapter 4 Entity Relationship (E-R) Modeling
Entity-Relationship (E-R) Model
Class Number – CS 304 Class Name - DBMS Instructor – Sanjay Madria Instructor – Sanjay Madria Lesson Title – ER Model.
Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Chapter 3)
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.
Entity-Relationship modeling Transparencies
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
1 The Entity-Relationship Model Chapter 2. 2 Overview of Database Design  Conceptual design : (ER Model is used at this stage.)  What are the entities.
Chapter 3: Modeling Data in the Organization
Dr. Mohamed Osman Hegaz1 Conceptual data base design: The conceptual models: The Entity Relationship Model.
Entity-Relationship Model
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Data Modeling Using the Entity-Relationship
DATABASEMODELSDATABASEMODELS  A database model ◦ defines the logical design of data. ◦ Describes the relationships between different parts of data.
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.
Dr. Ahmad R. Hadaegh A.R. Hadaegh California State University San Marcos (CSUSM) Page 1 Entity Relational Diagram (ERD) Modeling This particular lecture.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Chapter 7: Modeling Data in the Organization Dr. Taysir Hassan Abdel Hamid IS Department Faculty of Computer and Information Assiut University March 8,
ER to Relational Translation John Ortiz. Lecture 5ER to Relational Translation2 Recall Database Design  Steps in database design Requirement Analysis.
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.
Entity – Relationship Model (E-R Model)
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.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
Database Management Systems MIT Lesson 02 – Database Design (Entity Relationship Diagram) By S. Sabraz Nawaz.
1 Conceptual Design using the 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.
Lecture 03 Entity-Relationship Diagram. Chapter Outline.
The Entity-Relationship (ER) Model. Overview of db design Requirement analysis – Data to be stored – Applications to be built – Operations (most frequent)
11 Chapter 3 The ER Model The high-level conceptual data model The first step in database design process is requirements collection and analysis.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Data Modeling Using the Entity-Relationship (ER) Data Model.
Chapter 3: Data Modeling Using the Entity-Relationship (ER) Data Model
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
Data Modeling and the Entity-Relationship Model CS 475 Lecture Notes.
CSE 412/598 DATABASE MANAGEMENT COURSE NOTES 3. ENTITY-RELATIONSHIP CONCEPTUAL MODELING Department of Computer Science & Engineering Arizona State University.
©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.
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.
Chapter 7 Data Modeling Using the Entity-Relationship (ER) Model
The Entity-Relationship Diagram for Data Modeling
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Entity Relationship Model
Chapter -3- Data Modeling Using the Entity-Relationship Model
Presentation transcript:

Entity-Relationship Model Ch. 3 Mr John Ortiz

Overview of Database Design Steps in building a database for an application Requirement analysis. Specify what need to be modeled in a real-world domain Conceptual design. Specify a high level schema using a database design model Logical design. Refine a conceptual design to a schema using the data model of a DBMS Physical design. Define the schema using the DDL of the DBMS Database creation. Load data into a database Lecture 2 Entity-Relationship Model

Overview of Database Design Real-world domain Database design model (ER, OO) DBMS data model (relational, OO, OR) Design-to-DBMS step may be automated (e.g., ER-to-relational) Middle step sometimes skipped (directly to relational model) Lecture 2 Entity-Relationship Model

Entity-Relationship Model Requirement Analysis Need to interact with domain experts Application specific Time consuming Very important Difficult to be thorough Lecture 2 Entity-Relationship Model

Entity-Relationship Model A Sample Requirement Consider a regional hospital. There are doctors, patients, nurses, prescriptions, tests, … Each doctor has Id, Name, Specialty, Age, Sex, … Patients see doctors, doctors prescribe drugs to patients, … Each patient has one primary care physician, a nurse is assigned to at most 5 patients, … Lecture 2 Entity-Relationship Model

Entity-Relationship Model Conceptual Design Design a high level schema based on requirements Why do we do a conceptual design? To communicate with domain experts (use concepts of the application domain). It is easier to set up a good model (focus on data content not structure) Flexible (system independent, hmm… ) How to describe a conceptual design? Use an ER Diagram (most popular) Lecture 2 Entity-Relationship Model

Entity-Relationship Model Proposed by Peter Chen in 1976 Historically very popular Graphical Major concepts: entity type, relationship type, attribute, constraints, … Lecture 2 Entity-Relationship Model

Entity-Relationship Model Entity Type Entity. A real-world object distinguishable from other objects. Each entity is described by a set of attributes (or properties). Entity Type. A definition of a collection of entities with identical set of attributes. Students ssn name gpa  Can informally think of entities as records Lecture 2 Entity-Relationship Model

Entity-Relationship Model Relationship Type Relationship. An association between two or more entities (usually of different types). A relationship may also have attributes. Relationship Type. A definition of a collection of relationships with the identical set of attributes. gpa title credit cno grade name Enrolled Courses Students ssn Not every entity participates in a relationship Lecture 2 Entity-Relationship Model

Entity-Relationship Model Attributes Domain of an attribute. The set of values the attribute may take. Many types of attributes. (simple vs composite, single-value vs multi-value, stored vs derived) Students ssn gpa name fname minit lname hobby bdate age Lecture 2 Entity-Relationship Model

Degree of Relationships Degree. Number of entity types involved in a relationship type. (unary, binary, ternary, … ) Role. Part played by entities of a unary relationship. Reports_To lot name subor-dinate super-visor ssn Employees name city S# Suppliers P# color Parts Order Projects J# dept qty Lecture 2 Entity-Relationship Model

Entity-Relationship Model Key Constraint Key Attribute(s). A set of attributes of an entity type whose values are unique for each entity of that type. Key Constraint. Every (almost!) entity type must have a key attribute(s). (e.g., ssn of Students) Lecture 2 Entity-Relationship Model

Participation Constraint Participation Constraint. Whether or not every entity in an entity type participates in a type of relationship. Either total or partial. gpa grade name takes Students ssn title credit cno Courses Every course is taken by some students Lecture 2 Entity-Relationship Model

Cardinality Constraints Cardinality Ratio. Whether or not an entity of a type may involve in a type of relationship with multiple entities of another type. One-to-one (1-to-1). Each entity in E1 is associated with 0 or one entity in E2, and vice versa. Employees manages Departments ssn dno name age since room 1 Other notation exists Lecture 2 Entity-Relationship Model

Cardinality Constraints One-to-many (1-to-m). Each entity in E1 is associated with 0 or more entities in E2, and each entity in E2 is associated with 0 or one entity in E1. The reverse is many-to-one (m-to-1). Professors advises Students ssn name room gpa 1 m To determine for Student, fix a Professor, see how many students are advised by him. Lecture 2 Entity-Relationship Model

Cardinality Constraints Many-to-many (m-to-n). Each entity in E1 is associated with 0 or more entities in E2, and vice versa. Students takes Courses ssn cno name gps title credit m n grade This is the default if not labeled Lecture 2 Entity-Relationship Model

Multiway Relationships What does it say? Parts Suppliers Projects order m n r Pick an entity from each of the other 2 entity types, how many entities in the third entity type are associated with the pair? What if r = 1? What if both r =1 and n=1? Lecture 2 Entity-Relationship Model

Entity-Relationship Model Weak Entity Type Weak Entity Type. An entity type without its own key. Typically have a partial key. Must totally participate in an identifying relationship with a strong entity type. The relationship must be m-to-1 or 1-to-1. Universities have Student_clubs name cname city size phone type 1 m How to refer to a weak entity? Lecture 2 Entity-Relationship Model

Extended ER Model (EER) Structural Constraint. The min & max number of relationships in R that each entity in E must participate. E (min, max) R Students takes Courses ssn cno name gps title credit (1,5) (5,40) grade Lecture 2 Entity-Relationship Model

Cardinality ve Structural Cardinality Structural R E (0, 1) F 1 (0, m) m (0, n) n (1, 1) The labels are placed in reverse order. Lecture 2 Entity-Relationship Model

Entity-Relationship Model Look Ahead Next topic: Relational Data Model Read from the textbook: Chapter 7.1-7.3 Lecture 2 Entity-Relationship Model