1 The Entity- Relationship Model Instructor: Mohamed Eltabakh

Slides:



Advertisements
Similar presentations
Entity Relationship Diagrams
Advertisements

Chapter 6: Entity-Relationship Model (part I)
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
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.
--The Entity Relationship Model(1)--1 The Entity Relationship Model.
Data Modeling ISYS 464. Database Design Process Conceptual database design: –The process of creating a data model independent of implementation details.
1–1 The E-R Model Prof. Sin-Min Lee Department of Computer Science.
CS34311 The Entity- Relationship Model. CS34312 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design Conceptual.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
CS34311 The Entity- Relationship Model Part II.. CS34312 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
1 Data Modelling Which data to include in the database.
Murali Mani The Entity- Relationship Model. Murali Mani Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design.
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.
the Entity-Relationship Model
Dr. Mohamed Osman Hegaz1 Conceptual data base design: The conceptual models: The Entity Relationship Model.
1 Data Modeling : ER Model Lecture Why We Model  We build models of complex systems because we cannot comprehend any such system in its entirety.
Relational Algebra Instructor: Mohamed Eltabakh 1.
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
©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.
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
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:
Computing & Information Sciences Kansas State University Wednesday, 24 Sep 2008CIS 560: Database System Concepts Lecture 12 of 42 Wednesday, 24 September.
CS3431: C-Term The Entity- Relationship Model Part II. Instructor: Mohamed Eltabakh
Chapter 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
 An entity-relationship diagram (ERD) is a specialized graphic that illustrates the interrelationships between entities in a database.
1 Translating ER Schema to Relational Model Instructor: Mohamed Eltabakh
Logical Design database design. Dr. Mohamed Osman Hegaz2 Conceptual Database Designing –Provides concepts that are close to the way many users perceive.
ITTelkom Entity Relationship Diagram (1) CS2343 Perancangan Basisdata Relasional.
Databases Illuminated Chapter 3 The Entity Relationship Model.
Data Modelling Using Entity-Relationship (ER) Model
Database and Information Retrieval System
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Data Modeling Using the Entity-Relationship (ER) Data Model.
1 The Entity- Relationship Model Instructor: Mohamed Eltabakh Part-2.
CS34311 The Entity- Relationship Model Part I.. CS34312 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design.
The Entity-Relationship Model
1 The Entity- Relationship Model Instructor: Mohamed Eltabakh Part-3.
Ashima Wadhwa. database  A database can be modeled as: ◦ a collection of entities, ◦ relationship among entities. entity  An entity is an object that.
Data Modeling and the Entity-Relationship Model CS 475 Lecture Notes.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
CS3431-B111 The Entity- Relationship Model Part II. Instructor: Mohamed Eltabakh
Lecture 26 Enterprise Systems Development ( CSC447 ) COMSATS Islamabad Muhammad Usman, Assistant Professor.
CS3431: C-Term Translating ER Schema to Relational Model Instructor: Mohamed Eltabakh
CS34311 Translating ER Schema to Relational Model.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
ENTITY-RELATIONSHIP MODELLING. Objectives: How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated with ER model.
Translating ER Schema to Relational Model
Data Modeling Using the ERD
Entity-Relationship Model
Entity Relationship Diagram
ER model Ashima Wadhwa.
Entity-Relationship Model
Entity Relationship Model
Entity-Relationship Model
Tables and Their Characteristics
Translating ER Schema to Relational Model
The Entity-Relationship Model
The Entity-Relationship Model
Entity Relationship Diagrams
Chapter Entity-Relationship Modeling & Enhanced Entity- Relationship Modeling.
Chapter Entity-Relationship Modeling & Enhanced Entity- Relationship Modeling.
Entity Relation Model Tingting Zhang.
Presentation transcript:

1 The Entity- Relationship Model Instructor: Mohamed Eltabakh

2 Database Design Stages Application Requirements Conceptual Design Logical Design Physical Design Conceptual Schema Logical Schema Physical Schema ER Model Relational Model Creating tables in a DBMS

3 Conceptual Design What is Conceptual Design? Concise representation of the DB application requirements Why Conceptual Design ? It helps to understand application requirements better It helps to communicate our understanding of application It helps to come up with a ‘good’ design

Example: Banking System There are customers, each customer has some attributes: customer-id, customer-name, customer-street, customer-city. The bank offers loans to customers, where each loan has a loan-number, and the amount of the loan A customer can borrow multiple loans from the bank, but each loan can be borrowed by only one customer. 4 This big story is captured in a better way using an ER model

5 Conceptual Design (Cont’d) Conceptual Models ER (Entity-Relationship) Model,  Our focus UML (Unified Modeling Language), ORM (Object Role Modeling), etc. ER Model Structures: Entities and Relationships Constraints An ER schema is represented using Entity- Relationship Diagram (ERD)

Modeling A database can be modeled as: Collection of entities, Relationship among entities. An entity is an object that exists and is distinguishable from other objects. Example: a person, company, event, bank account, store, etc. Entities have attributes Example: a person has name, address, SSN, … An entity set is a set of entities of the same type that share the same properties. Example: set of all persons, companies, trees, holidays 6

7 ER: Entity Sets and Attributes Entity set : Represent a set of “objects” Attribute: property of an entity, has a domain In ER diagram Entity set  rectangle Attribute  Oval. Entity Set Student with attributes (sNumber, sName, sAge)

Example: University System What entity sets come to your mind… 8 Student Professor Building Employee Course Classroom

Attributes Types Primitive attributes: Attribute stores a single value (Number, String, Boolean, Date, …) Composite attributes: An attribute can be divided into sub- attributes (each is primitive) Multi-values attributes: Attribute with many values Derived attributes: Attributes computed from others 9 These are primitive attributes DoB

10 Complex Attributes Composite Attribute: address Multivalued Attribute: major Derived Attribute: Age Age Student entity set with all its attributes Age DoB

Expand Your Design: University System Add attributes for each entity set 11 Student Professor Building Employee Course Classroom Name Address Establishing Year

12 Relationship Types Relationship: Association (connection) between entities sets Relationship Type: Class of relationships Representation: Use a diamond shape Relationship type HasTaken to represent Courses taken by Students

13 Relationships with Attributes Relationship HasTaken has an attribute project which is the project the Student did for the Course A relationship may have attributes These attributes do not belong to any of the connected entities. But they belong the relationship

14 Example I (Simple Application) Suppliers have a name, and location. Products have a name, price, and number. Consumers have a name, and location. Suppliers supply products on certain dates, while consumers buy products of certain quantity How would you model this application? a) What are the entities and attributes? b) What are the relationships?

Modeling of Example I 15 supplier sName sLoc consumer cName cLoc product pNumbe r sName sPrice supplies buys date quantity This ER captures exactly what is written in text >> It is wrong to add “date” or “quantity” to one of the entity sets

16 Example II (More Complicated) Suppliers have a name, and location. Products have a name, and number. Consumers have a name, and location. Some Suppliers have established contracts to supply a certain Product to a particular Consumer for specially negotiated price at a given quantity. How would you model this application?

17 Modeling of Example II Model the relationship Supplier supplies Products to Consumers Ternary relationship (three-way)

Binary vs. Multi-way Relationships 18 supplier sName sLoc consumer cName cLoc product pNumbe r sName supplies buys price quantity Binary relationship

19 ER Model so far Entities and entity sets Relationships Binary, ternary, multi-way Attributes For entity sets and relationship types Simple, composite, multi-valued, derived

20 Entities with Different Attribute Types (Recap) Composite Attribute: address Multivalued Attribute: major Derived Attribute: Age Age Student entity type with all its attributes Age DoB Primitive Attribute: sNumber sNumber

Binary Relationships (Recap) 21 supplier sName sLoc consumer cName cLoc product pNumbe r sName sPrice supplies buys date quantity Attributes can be attached to Entity Sets or Relationships

22 Multi-Way Relationships (Recap) Model the relationship Supplier supplies Products to Consumers Ternary relationship (three-way)

23 Recursive Relationship Types and Roles Refer to the same entity set in the relationship Recursive relationship type : Part-Subpart Roles: There are Parts that play the role of superPart There are Parts that play the role of subPart If two entities in the same entity set have a relationship  Recursive relationship

Recursive Relationships: Another Example 24 Employees & Managers Employee ID Name Supervise supervisor supervised

What about an Exercise: University System Lets enrich this initial design… 25 Student Professor Building Employee Course Classroom Name Address Establishing Year