Data Modeling using the Entity-Relationship (ER) Model

Slides:



Advertisements
Similar presentations
Entity-Relationship (ER) Modeling
Advertisements

Entity Relationship (ER) Modeling
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
Concepts of Database Management Seventh Edition Chapter 6 Database Design : ERD Model.
Chapter 4 Entity Relationship (E-R) Modeling
Entity Relationship (ER) Modeling
Text-Book Chapters (7 and 8) Entity-Relationship Model
1–1 The E-R Model Prof. Sin-Min Lee Department of Computer Science.
Chapter 3: Modeling Data in the Organization
Information Resources Management January 30, 2001.
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
Chapter 3 © 2005 by Prentice Hall 1 Objectives Definition of terms Definition of terms Importance of data modeling Importance of data modeling Write good.
Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Chapter 3)
CSCI 242 Relational Data Modeling Copyright 2011, David C. Roberts, all rights reserved.
APPENDIX C DESIGNING DATABASES
Data Modeling 1 Yong Choi School of Business CSUB.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
Entity Relationship Modeling Objectives: To illustrate how relationships between entities are defined and refined. To know how relationships are incorporated.
Data Modeling Using the Entity-Relationship Model
Entity-Relationship modeling Transparencies
1 © Prentice Hall, 2002 Chapter 3: Modeling Data in the Organization Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred.
1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name Position (123) University Name.
3.1 CSIS 3310 Chapter 3 The Entity-Relationship Model Conceptual Data Modeling.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
the Entity-Relationship Model
CONCEPTS OF E-R MODEL. CONTENTS Entity Attributes Data Value Entity Types Types of Entity Types Relationships Relationship Constraints.
Data Modeling ERM ERD.
Entities and Attributes
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 (ER) Modelling
Chapter 5 Entity–Relationship Modeling
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
IS 325 Notes for Wednesday September 4, Syllabus Change I eliminated quizzes I increased the points allocated to homework assignments.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
DATABASEMODELSDATABASEMODELS  A database model ◦ defines the logical design of data. ◦ Describes the relationships between different parts of data.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 1 © Akhilesh Bajaj, 2000, 2002, 2003, 2004.
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.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Chapter 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
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.
Data Modeling Using the Entity-Relationship (ER) Model.
Chapter 7 Data Modeling with Entity Relationship Diagrams
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.
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.
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Entity Relationship 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 Using the Entity-Relationship (ER) Data Model.
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.
ERD :: 19 / 1 / Entity-Relationship (ER) Modeling. ER Modeling is a top-down approach to database design. Entity Relationship (ER) Diagram –A.
Database -Entity-Relationship Model 2012/03/05.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Entity Relationship Modeling
Entity-Relationship Model
ER model Ashima Wadhwa.
Entity-Relationship Model
Entity Relationship Model
Overview of Entity‐Relationship Model
Database Systems: Design, Implementation, and Management Tenth Edition
Database Modeling using Entity Relationship Model (E-R Model)
ER MODELING Instructor: SAMIA ARSHAD
Presentation transcript:

Data Modeling using the Entity-Relationship (ER) Model Lecture 6

Data Model Data model is a collection of conceptual tools for describing data and data relationships. The data model focuses on what data should be stored in the database. MIS 4102- Summer 2012

Data model There are various data models available. They are: Entity-Relationship model (ER model) Object-oriented model Relational model Network model Hierarchical model MIS 4102- Summer 2012

Approaches to Database Design Entity-Relationship (ER) data modeling A graphical technique for understanding and organizing the data independently of the final database implementation. It is a top-down approach to data analysis Normalization (in relational data model) An algorithmic process for evaluating the quality of a database design, most applicable to relation database design. It is a bottom-up approach to data analysis MIS 4102- Summer 2012

Top-down/Bottom up approach Data model is derived from an close understanding of the business. Bottom-up Data model is derived by reviewing specifications and business documents. MIS 4102- Summer 2012

Entity-Relationship model Peter P. Chen originally proposed the Entity- Relationship (ER) model in 1976. The ER model is a conceptual data model that consists of a set of basic objects called entities, and of relationships among these entities. In ER modeling, data is described as entities, relationships, and attributes. MIS 4102- Summer 2012

Association between the instances of one or more entity types EntityName Verb Phrase AttributeName Person, place, object, event or concept about which data is to be maintained named property or characteristic of an entity Represents a set or collection of objects in the real world that share the same properties MIS 4102- Summer 2012

Entities One of the basic components of ER model is entity. An entity is any distinguishable object about which information is stored. These objects can be person, place, thing, event or a concept. Entities contain descriptive information. Each entity is distinct. An entity may be physical or abstract. A person, a book, car, house, employee etc. are all physical entities whereas a company, job, or a university course, are abstract entities. MIS 4102- Summer 2012

Entities (cont…) Entities can be independent or dependent (in some methodologies, the terms used are strong and weak, respectively) entity. An independent entity is one, which does not rely on another entity for identification. A dependent entity is one that relies on another entity for identification. An independent entity exists on its own whereas dependent entity exists on the existence of some other entity. For example take an organization scenario. Here department is independent entity. Department manager is a dependent entity. It exists for existing depts. There won't be any department manager for which there is no dept. MIS 4102- Summer 2012

Attributes Attributes are basically properties of entity. We can use attributes for identifying and expressing entities. For example, Dept entity can have DeptName, DeptId, and DeptManager as its attributes. A car entity can have modelno, brandname, and color as its attributes. A particular instance of an attribute is a value. For example, “Azad" is one value of the attribute Name. Employee number 8005 uniquely identifies an employee in a company. The value of one or more attributes can uniquely identify an entity. MIS 4102- Summer 2012

Entities and Attributes Fig - Entity and its attributes In the above figure, employee is the entity. EmpNo, Name, Designation and Department are its attributes. MIS 4102- Summer 2012

Types of Attributes Attributes can be of various types: Key or non key attributes Required or optional Attributes Simple or composite Attributes Single-valued and multi-valued Attributes Stored, Coded or derived Attributes MIS 4102- Summer 2012

Key or non-key attributes An entity usually has an attribute whose values are distinct for each individual entity. This attribute uniquely identifies the individual entity. Such an attribute is called a key attribute. For example, in the Employee entity type, EmpNo is the key attribute. A descriptor describes a non-unique characteristic of an entity instance. For example, in the Employee entity type, EmpName is the non-key attribute. There may be a case when one single attribute is not sufficient to identify entities. Then a combination of attributes can solve this purpose. That is known as a composite key attribute. MIS 4102- Summer 2012

Required / Optional Attributes An attribute can be required or optional. When it's required, we must have a value for it, a value must be known for each entity occurrence. When it's optional, we could have a value for it, a value may be known for each entity occurrence. For example, there is an attribute EmpNo (for employee no.) of entity employee. This is required attribute since here would be no employee having no employee no. Employee's spouse is optional attribute because an employee may or may not have a spouse. MIS 4102- Summer 2012

Simple and composite Attributes Composite attributes can be divided into smaller subparts. These subparts represent basic attributes with independent meanings of their own. For example, take Name attributes. We can divide it into sub-parts like First_name, Middle_name, and Last_name. Attributes that can’t be divided into subparts are called Simple or Atomic attributes. For example, EmployeeNumber is a simple attribute. Age of a person is a simple attribute. MIS 4102- Summer 2012

Single-valued and multi-valued Attributes Attributes that can have single value at a particular instance of time are called single-valued. A person can’t have more than one age value. Therefore, age of a person is a single-values attribute. A multi-valued attribute can have more than one value at one time. For example, degree of a person is a multi-valued attribute since a person can have more than one degree. MIS 4102- Summer 2012

Stored, coded, or derived Attributes There may be a case when two or more attributes values are related. Take the example of age. Age of a person can be calculated from person’s date of birth and present date. Difference between the two gives the value of age. In this case, age is the derived attribute. The attribute from which another attribute value is derived is called stored attribute. In the above example, date of birth is the stored attribute. A coded value uses one or more letters or numbers to represent a fact. For example, the value Gender might use the letters "M" and "F" as values rather than "Male" and "Female". MIS 4102- Summer 2012

Entity Types An entity type defines a set of entities that have same attributes. A database usually contains groups of entities that are similar. For example, employees of a company share the same attributes. However, every employee entity has its own values for each attribute. MIS 4102- Summer 2012

Value Sets (domain) of Attributes Domain is set of all possible values for an attribute. For example, we can specify the value set for designation attribute as <“Prof”, “Assit Prof”, “Senior Lecturer”, “Lecturer”>. We can specify “Name” attribute value set as <strings of alphabetic characters separated by blank characters>. The domain of Name is a character string. MIS 4102- Summer 2012

Relationships After identification of entities and their attributes, the next stage in ER data modeling is to identify the relationships between these entities. A relationship is any association, linkage, or connection between the entities. Typically, a relationship is indicated by a verb connecting two or more entities. borrows member book MIS 4102- Summer 2012

Relationships (cont…) Author Book writes An author writes one or more books A book can be written by one or more authors. MIS 4102- Summer 2012

Degree of Relationship The degree of a relationship is the number of entities associated with the relationship. One entity – Unary relationship Two entities – Binary relationships Three entities – Ternary relationships Relationship of degree higher than three are rare MIS 4102- Summer 2012

A Unary Relationship Pre-requisite for course Role name MIS 4102- Summer 2012

A Binary Relationship Binary relationships, the association between two entities are the most common type in the real world. Enrolls in student course MIS 4102- Summer 2012

A Ternary Relationship A ternary relationship involves three entities and is used when a binary relationship is inadequate. Many modeling approaches recognize only binary relationships. Ternary relationships are decomposed into two binary relationships. Sales Vendor purchaser item MIS 4102- Summer 2012

Relationship Connectivity/ Cardinality By connectivity we mean how many instances of one entity are associated with how many instances of other entity in a relationship. The basic types of connectivity for relations are: one-to-one (1:1), one-to-many (1:M), and many-to many (M:N). Indicated on the ER diagram by placing an appropriate symbol on each “leg” of the relationship. MIS 4102- Summer 2012

Relationship Connectivity Head of staff school 1 teaches lecturer course 1 M course pre-requisite for Pre-requisite M N Enrolls in student course M N MIS 4102- Summer 2012

One-to-One (1:1) Relationship A one-to-one (1:1) relationship is when at most one instance of an entity A is associated with one instance of entity B. The relationship between a BankAccount entity and a Customer entity can be said to be one-to-one (1:1) if it can be define in the following way: A bank account is held by at most one customer. A customer may hold at most one bank account. Customer BankAccount MIS 4102- Summer 2012

One-to-Many (1:N) Relationship A one-to-many (1:N) relationship is when for one instance of entity A, there are zero, one, or many instances of entity B but for one instance of entity B, there is only one instance of entity A. In contrast, the relationship between BankAccount and Customer is one-to-many (1:M) if it is defined as: A customer holds many bank accounts. A bank account is held by at most one customer. Customer BankAccount MIS 4102- Summer 2012

Many-to-Many (M:N) Relationship A many-to-many (M:N) relationship is when for one instance of entity A, there are zero, one, or many instances of entity B and for one instance of entity B there are zero, one, or many instances of entity A. In contrast, the relationship between BankAccount and Customer is many-to-many (M:N) if it is defined as: A customer holds many bank accounts. A bank account may be held by many customers. Customer BankAccount MIS 4102- Summer 2012

Relationship Participation Participation (or optionality) concerns the involvement of entities in a relationship. An entity’s participation is optional if there is at least one instance of an entity which does not participate in the relationship. An entity’s participation is mandatory if all instance of an entity must participate in the relationship. We assume that the default participation is mandatory. If the participation is optional we add a circle (an ‘O’ for optional) alongside the relevant entity. MIS 4102- Summer 2012

Relationship Participation (cont…) Department Lecturer Here the entity Lecturer has mandatory status while the entity Department is optionally involved in the relationship. That is: Every lecturer must be employed within a department. A department may exist without any lectures. MIS 4102- Summer 2012

Multiple relationships More than one relationship can exist between given entity types Examples: Head of staff school 1 memberof N MIS 4102- Summer 2012

Designing basic model and E-R Diagrams In order to begin constructing the basic model, the modeler must analyze the information gathered during the requirement analysis for the purpose of: and classifying data objects as either entities or attributes, identifying and defining relationships between entities, naming and defining identified entities, attributes, and relationships, documenting this information in the data document. Finally draw its ER diagram. MIS 4102- Summer 2012

E-R diagrams constructs In E-R diagrams, entity types are represented by squares. Relationship types are shown in diamond shaped boxes attached to the participating entity types with straight lines. Attributes are shown in ovals, and each attribute is attached to its entity type or relationship type by a straight line. Multi-valued attributes are shown in double ovals. Key attributes have their names underlined. Derived attributes are shown in dotted ovals. Weak entity types are distinguished by being placed in double rectangles and by having their identifying relationship placed in double diamonds. MIS 4102- Summer 2012

E-R diagrams constructs (cont…) MIS 4102- Summer 2012

Naming Data Objects The names should have the following properties: unique, have meaning to the end-user. contain the minimum number of words needed to uniquely and accurately describe the object. For entities and attributes, names are singular nouns while relationship names are typically verbs. MIS 4102- Summer 2012

E-R Diagram for library management system In the library Management system, the following entities and attributes can be identified. Book -the set all the books in the library. Each book has a Book-id, Title, Author, Price, and Available (y or n) as its attributes. Member-the set all the library members. The member is described by the attributes Member_id, Name, Street, City, Zip_code, Mem_type, Mem_date (date of membership), Expiry_date. Publisher-the set of all the publishers of the books. Attributes of this entity are Pub_id, Name, Street, City, and Zip_code. Supplier-the set of all the Suppliers of the books. Attributes of this entity are Sup_id, Name, Street, City, and Zip_code. MIS 4102- Summer 2012

E-R Diagram for library management system (cont…) Assumptions: a publisher publishes a book. Supplier supplies book to library. Members borrow the book (only issue). Return of book is not taken into account MIS 4102- Summer 2012

E-R Diagram for library management system (cont…) MIS 4102- Summer 2012

Any Question ? MIS 4102- Summer 2012

Thanks to All MIS 4102- Summer 2012