Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.

Slides:



Advertisements
Similar presentations
Entity Relationship Diagrams
Advertisements

Chapter 31 Chapter 3 Data Modeling Using the Entity-Relationship Model.
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Entity Relationship (ER) Modeling
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
CSC271 Database Systems Lecture # 22. Summary: Previous Lecture  Applying Database SDLC on DreamHome  Database planning  System definition  Requirements.
Data modeling using the entity-relationship model Sept. 2012Yangjun Chen ACS Outline: Data modeling using ER-model (Chapter 3 - 3rd, 4th, 5th ed.)
Conceptual Models Agenda - Steps in the design of a DB - Need for conceptual models - The Entity-Relationship Model (ER-Model)
Lecture Eleven Entity-Relationship Modelling
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 4 Entity Relationship (E-R) Modeling
Data modeling using the entity-relationship model Winter 2006Ron McFadyen Entity-relationship model (ER model) P. 49: “This model and its variations.
Chapter 4 Entity-Relationship modeling Transparencies © Pearson Education Limited 1995, 2005.
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
Entity-Relationship modeling Transparencies
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
Data Modeling Using the Entity-Relationship Model
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
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.
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
Dr. Mohamed Osman Hegaz1 Conceptual data base design: The conceptual models: The Entity Relationship Model.
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Entity-Relationship Model
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 5 Entity–Relationship Modeling
Chapter 11 (I) CIS458 Sungchul Hong. Chapter 11 - Objectives How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated.
IS 325 Notes for Wednesday September 4, Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments.
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
© Pearson Education Limited, Chapter 7 Entity-Relationship modeling Transparencies.
Entity-Relationship Modeling Based on Chapter 12.
1 Chapter 11 Entity-Relationship Modeling Transparencies Last Updated: 25 April 2011 By M. Arief
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 
Chapter 12 Entity-Relationship Modeling Pearson Education © 2009.
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.
3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
1 Entity-Relationship Model © Pearson Education Limited 1995, 2005.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 4 ENTITY RELATIONSHIP (ER) MODELING Instructor Ms. Arwa Binsaleh 1.
Entity-Relationship Model Chapter 3 II COSC 457 Sungchul Hong.
Data Modelling Using Entity-Relationship (ER) Model
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
1 Database Systems Entity Relationship (E-R) Modeling.
Chapter 3: Data Modeling Using the Entity-Relationship (ER) Data 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.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
ENTITY-RELATIONSHIP MODELLING. Objectives: How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated with ER model.
Data Modeling Using the Entity- Relationship (ER) Model
TMC2034 Database Concept and Design
Tables and Their Characteristics
Entity-Relationship Modeling
بسم الله الرحمن الرحيم.
Entity Relationship Diagrams
Entity-Relationship Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Conceptual Data Modeling Using Entities & Relationships
Chapter 4 Entity Relationship (ER) Modeling
Entity Relation Model Tingting Zhang.
Chapter # 4 Entity Relationship (ER) Modeling.
Presentation transcript:

Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented in relational modeling. Data Models Notations ( Chens and Crows Foot notation) Classification Of Attributes. How to identify candidate,primary and foreign key and alternate keys. Combining the different datasets and represent them as a data model.. 1

Data modeling using the entity-relationship model Database In this Chapter, we describe the main techniques for gathering and capturing information about what the users require of a database system. One of the most difficult aspects of database design is the fact that designers, database designers and end-users tend to view data and its use in different ways. Unfortunately unless we get a common understanding that reflects how the enterprise operates the design we produce will fail to meet the user requirements. We need to get a model for communication that is non-technical and free of ambiguities.

Data modeling using the entity-relationship model Database Entity-relationship model (ER model) ER model: Is used to create a Conceptual /theoretical data model that reflects all the user data requirements. It includes detailed descriptions of entity types, relationships, and Constraints. It is majorly used for communication with non- technical users

Data modeling using the entity-relationship model ERD Development Process i). Identity the Entities. ii).Determine the attributes for each entity. iii).Select the primary key for each entity. iv).Establish the relationship between the entities. v).Draw an Entity model 4 Database

Data modeling using the entity-relationship model Database 1. Entities. An entity can be classified in one of the following categories. Strong entity - An entity type is strong if its existence does not depend on some other entity type Weak entity: Is an entity that is dependant on the existence of another entity. It cannot be uniquely identified by its attributes alone. Does not have a key of its own - It’s identified by being related to another (Strong) entity type using some of their attribute values. It’s main characteristics - identifying owner - identifying relationship - Does not have a key of its own

Data modeling using the entity-relationship model 2. Determine the Attributes Every Entity has Attributes. Attributes are characteristics that allow users to classify / describe an entity. Attribute Domain –Set of allowable values for one or more attributes. For example the attribute GPA is written (0,5). The domain for an attribute Gender consists of only 2 possibilities M or F. Eg An Entity student has the attributes. - Student number -Name -Date of Birth -Course Number 6 Database

Data modeling using the entity-relationship model Database Concepts (you should understand) Attribute classification Simple attribute Composite Attribute Single Valued Attribute multi valued attribute Derived Attribute Key attribute: Candidate Key, Primary Key, Alternate Key. Null values: not applicable, unknown, missing.

Data modeling using the entity-relationship model Database Attributes Simple Attribute –Attribute composed of a single component with an independent existence. Simple attributes cannot be further subdivided into smaller components. Eg age, marital status. Composite Attribute -Some attributes can be further divided to yield smaller components with independent existence. –Attribute composed of multiple components, each with an independent existence. Eg Address ( 163 main st, Glasgow, G11 9QX) can be divided in to Street, city and postcode, DOB

Data modeling using the entity-relationship model Database Attributes Single-valued Attribute –Attribute that holds a single value for each occurrence of an entity type. Eg ? ? Multi-valued Attribute –Attribute that holds multiple values for each occurrence of an entity type. Eg?? Derived Attribute –Attribute whose value is calculated from other attributes. The derived attribute need not be physically stored within the database. –Eg Employee age can be found by computing an integer value difference of Current Date- DOB=

Data modeling using the entity-relationship model 10 Keys Certain attributes identify particular facts with an entity, these are known as KEY attributes. Candidate Key –Minimal set of attributes that uniquely identifies each occurrence of an entity type. Primary Key –Field that is selected to uniquely identify each occurrence of an entity type. Alternate Key Candidate keys that are not selected as the primary key

Data modeling using the entity-relationship model Naming and Defining Relationships A relationship is an association between entities. Relationship name is a verb phrase. Guidelines for defining relationships. Definition explains what action is being taken and why it is important. eg Supervises or manages 11 Database

Data modeling using the entity-relationship model Database A recursive association connects a single class type (serving in one role) to itself (serving in another role). Recursive Relationship Relationship type where same entity type participates more than once in different roles

Data modeling using the entity-relationship model Database Relationship Types Degree of a Relationship –Number of participating entities in relationship. Relationship of degree : –two is binary –three is ternary –four is quaternary.

Data modeling using the entity-relationship model Database Relationship Types Degree of a Relationship –Number of participating entities in relationship. Relationship of degree : –two is binary –three is ternary –four is quaternary.

Data modeling using the entity-relationship model Database Binary relationship called Has

Data modeling using the entity-relationship model Database Ternary relationship called Registers

Data modeling using the entity-relationship model Database Quaternary relationship called Arranges

Data modeling using the entity-relationship model Cardinality of a Relationship. Describes maximum number of possible relationship occurrences for an entity participating in a given relationship type. In ERD cardinality is indicated by placing the appropriate numbers beside the entities using the format ( x,y). x – minimum value, y – Maximum Value An example of a one to many relationship is when an employee can work for only one department, and a department can have many employees 18 Database

Data modeling using the entity-relationship model Database Consider some instances department employs instructor d1 d2 d3 e1 e2 e3 e4 e5 e6 e7

Data modeling using the entity-relationship model Many to Many relationship: Is a key constraint that indicates that many of one entity can be associated with many of another entity. An example of many to many relation is employees and their hobbies: A person can have many different hobbies and many people can have the same hobby. Database 20

Data modeling using the entity-relationship model Database Example The company database keeps track of a company’s employees, departments, and projects: Requirements: concerning the department: 1.company is organized into departments 2.a department has a unique name, a unique number, and a specific employee is its’ manager 3.we track the start date for the manager function 4.a department may be in several locations 5.a department controls a number of projects concerning the project: 6.a project has a unique name, a unique number, and a location

Data modeling using the entity-relationship model Database example continued concerning the employee: 7.each employee has a name, social insurance number, address, salary, sex, and birth date 8.an employee is assigned to one department but may work on several projects which are not necessarily controlled by the same department 9.we track the number of hours per week that an employee works on each project 10.we keep track of the direct supervisor of each employee 11.we track the dependents of each employee (for insurance purposes) concerning the dependent: 12.we record each dependent’s first name, sex, birth date, and relationship to the employee

Data modeling using the entity-relationship model Basic ERD symbols Entity Attribu te Multi Valued Attribute Relationsh ip Derived attribute Derived Attribute 23 Database

Data modeling using the entity-relationship model Database The entities/Relations: employee department project dependent

Data modeling using the entity-relationship model Database The entities/Relations: bdate ssn namesex address salary birthdatenamesex relationship name numberlocation name numberlocation employee department project dependent

Data modeling using the entity-relationship model Database With relationships: employee department project dependent works for manages works on dependents of controls supervision 1 N N 1 NM 1 N 1 1 N 1 supervisor supervisee

Data modeling using the entity-relationship model Database Relationships Degree of a relationship Recursive relationship Constraints cardinality: m-n, 1-n, 1-1 Relationships are always labeled with verb phrases. PROFESSOR teaches a CLASS, BRANCH has STAFF. Concepts (you should understand)

Data modeling using the entity-relationship model Database Let’s consider a university environment: At a high level, we need to: offer courses register students assign instructors to courses assign grades anything else?

Data modeling using the entity-relationship model Database Instructors: let’s assume this classification includes instructors, professors, part-time people (at least for now). These people have SINs ( social insurance number), employee numbers, names, addresses, offices, phones,... instructor SIN office address employee no name phonedegree

Data modeling using the entity-relationship model Database instructor SIN office address employee no name phone Is there a key attribute? What are the domains? Can any attribute be null? Is any attribute composite, derived, multivalued? Is this a weak entity or a strong entity? Should department be an attribute? degree

Data modeling using the entity-relationship model Database Departments: obviously instructors are employed by the University and associated with a department A department has a name, number, office, chair(head of dept),... department Dnumber chair phone name office

Data modeling using the entity-relationship model Database department Dnumber chair phone name office Should chair be an attribute, or is there a relationship between two entity types? Is there a key attribute? What are the domains? Can any attribute be null? Is any attribute composite, derived, multivalued?

Data modeling using the entity-relationship model Database department Employs relationship: If we assume the relationship between department and instructor is 1:N. We associate any number of instructors with a single department instructor employs 1N 1:N is the cardinality of the relationship the relationship is of degree 2; it is a binary relationship

Data modeling using the entity-relationship model Database CONCLUSION The whole point about this chapter is “Given a dataset, how does one comeup with (i.e Design and formulate) entities and relationships and cardinalities between the different entities based on the business processes and needs of the organisation for which they are designing the database.