DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  www.desiamore.com/ifm B. Computer Science and BSc IT Year 1.

Slides:



Advertisements
Similar presentations
Chapter # 4 BIS Database Systems
Advertisements

Entity Relationship (E-R) Modeling Hachim Haddouti
Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
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
Systems Development Life Cycle
Data Modeling using the Entity-Relationship (ER) Model
Entity Relationship (E-R) Modeling
Lecture Eleven Entity-Relationship Modelling
Modeling Data The Entity Relationship Model (ER) For Database Design.
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 1 Data Models: Degrees of Data Abstraction l Modified ANSI/SPARC Framework.
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 4 Entity Relationship (E-R) Modeling
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
3 Chapter 3 Entity Relationship (E-R) Modeling Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name Position (123) University Name.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
the Entity-Relationship Model
1. 2 Data Modeling 3 Process of creating a logical representation of the structure of the database The most important task in database development E-R.
Entity-relationship Modeling Transparencies 1. ©Pearson Education 2009 Objectives How to use ER modeling in database design. The basic concepts of an.
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
Chapter 5 Entity Relationship (ER) Modelling
Chapter 5 Entity–Relationship Modeling
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
9/10/2012ISC 329 Isabelle Bichindaritz1 Entity Relationship (E-R) Modeling.
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.
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.
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.
1 A Demo of Logical Database Design. 2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational model.
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 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 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.
1 Database Systems Entity Relationship (E-R) Modeling.
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.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
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.
Entity Relationship (E-R) Model
TMC2034 Database Concept and Design
Tables and Their Characteristics
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 4 Entity Relationship (ER) Modeling
ER MODELING Instructor: SAMIA ARSHAD
Chapter # 4 Entity Relationship (ER) Modeling.
Presentation transcript:

DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1

DeSiamorePowered by DeSiaMore2 ENTITY-RELATIONALSHIP(E-R) MODELING  Outline … E-R Model Components of an E-R Model ERD Conventions Relationships

DeSiamorePowered by DeSiaMore3 ENTITY-RELATIONALSHIP(E-R) MODELING  E-R Model The Entity-Relationship (E-R) model is a high-level conceptual data model developed to facilitate database design by (Chen, 1976) A conceptual model is a set of concepts that describe  The structure of a database  The associated retrieval and  Update transactions on the database

DeSiamorePowered by DeSiaMore4 E-R Model…  The main purpose of developing a high-level data model is To support a user’s perception of the data and To conceal the more technical aspects associated with database design.  A conceptual data model is independent of the particular DBMS and hardware platform that is used to implement the database

DeSiamorePowered by DeSiaMore5 E-R Model…  The basic concepts of the E-R model include.. Entity types Relationship types and Attributes

DeSiamorePowered by DeSiaMore6 E-R Model…  Entity type An object or concept that is identified by the organisation as having an independent existence Represents a set of objects in the real world with the same properties Has an independent existence and can be an object with a physical (real) existence as employee, student, book, manager, customer, etc and an object with a conceptual (abstract) existence such as sale, inspection, satisfaction, and so on…..

DeSiamorePowered by DeSiaMore7 Components of an E-R Model  The E-R model forms the basis of the Entity Relationship Diagrams (ERDs)  The ERD represents the conceptual view of the database  The ERDs represent three main components entities Attributes relationships

DeSiamorePowered by DeSiaMore8 Components of an E-R Model…  Entity Is the fundamental item in any data model Is an instance of an entity type that is uniquely identifiable Each uniquely identifiable instance of an entity type is also referred to as entity occurrence or entity instance

DeSiamorePowered by DeSiaMore9 Components of an E-R Model…  Attribute An attribute is a single atomic of information that describes something about its named entity Example BOOK ( ISBN, Title, Author, Publisher, Publication_year, price ) STUDENT (Enrolled_No, Name, programme, stream, Age, sex, etc ) These representations are termed as the logical description of the entity since each one does not include the machine format for the entity and its attribute

DeSiamorePowered by DeSiaMore10 Components of an E-R Model…  Attribute… Each Attribute is associated with a set of values called domain The domain defines the potential values that an attribute may hold, Example, if the age of the student in the class is between 14 and 17, then we can define a set of values for the age attribute of the student entity as the set of integers between 14 and 17 A fully developed data model includes domains for each attribute in the E-R model

DeSiamorePowered by DeSiaMore11 Components of an E-R Model…  Attributes can be classified as following Simple Composite Single-valued Multi-valued Derived

DeSiamorePowered by DeSiaMore12 Components of an E-R Model…  Simple Attribute A simple attribute is an attribute composed of a single component with an independent existence, cannot be further subdivided Examples of simple attributes include; sex, age, salary etc. Simple attributes are sometimes called atomic attribute

DeSiamorePowered by DeSiaMore13 Components of an E-R Model…  Composite Attribute Is an attribute composed of multiple components, each with an independent existence. Some attributes can be further divided to yield smaller components with an independent existence of their own Example, the address attribute can be composed of components like street number, Area, City, Pin_code, and so on

DeSiamorePowered by DeSiaMore14 Components of an E-R Model…  Composite Attribute..

DeSiamorePowered by DeSiaMore15 Components of an E-R Model…  Single-Valued Attribute is one that holds a single value for a single entity Example, the classroom entity has a single value for the Room_Number and therefore the Room_Number attribute is referred to as being single-valued

DeSiamorePowered by DeSiaMore16 Components of an E-R Model…  Multi-valued Attribute Is one that holds multiple values for a single entity. Example, a student can have multiple values for the Hobby attribute –reading, music, movies, and so on.

DeSiamorePowered by DeSiaMore17 Components of an E-R Model…  Derived Attribute A derived attribute is one that represents a value that is derivable from the value of a related attribute or set of attributes, not necessarily in the same entity Example, age can be derived from the date-of-birth attribute and therefore they are related

DeSiamorePowered by DeSiaMore18 E-R Diagram Conventions  There are conventions for representing entities and attributes  These conventions are; The entity are represented by a rectangular box with the name of the entity in the box An attribute is shown as an ellipse attached to a relevant entity by a line and labelled with the attribute name The entity name is written in uppercase where as the attribute name is written in lowercase The primary key (key attributes) are underline

DeSiamorePowered by DeSiaMore19 E-R Diagram Conventions….  Conventions… The attributes are connected using lines to the entities. If the attribute is simple or single valued a single line is used If the attributes is derived a dotted line is used If it is multi-valued then double line are used If the attribute is composite, its component attributes are shown as ellipse emanating from the composite attribute see an example below

DeSiamorePowered by DeSiaMore20 E-R Diagram Conventions….

DeSiamorePowered by DeSiaMore21 Relationships  A relationship is an association between entities.  Each relationship is identified so that its name is descriptive of the relationships  Relationships are represented by diamond shaped symbols with the relationship name inside the diamond.  The two sides of the diamond are connected to the entities it relates

DeSiamorePowered by DeSiaMore22 Relationships….  Example, the figure below shows the relationship between the entities PUBLISHER and BOOK  A binary relationship exists when two entities are associated

DeSiamorePowered by DeSiaMore23 Relationships….  Terms associated with entities and relationships Degree Cardinality Connectivity Dependency Participation

DeSiamorePowered by DeSiaMore24 Relationships….  Degree The degree of a relationship indicates the number of associated entities. A unary relationship exists when an association is maintained within a single entity Example, consider the entity SUBJECT, consider a situation where to take a particular subject i.e, English, Maths etc This kind of a relationship is called a unary relationship as represented below

DeSiamorePowered by DeSiaMore25 Relationships….

DeSiamorePowered by DeSiaMore26 Relationships….  Ternary Relationship a ternary relationship exists when there are three entities associated, Example, the entities TEACHER, SUBJECT and STUDENT are related using a ternary relationship called ‘teaches’ as shown below

DeSiamorePowered by DeSiaMore27 Relationships….  Ternary Relationship…..

DeSiamorePowered by DeSiaMore28 Relationships….  A quaternary relationship exists when there are four entities associated,  Example, of a quaternary relationship is ‘studies’ where four entities are involved, STUDENT, TEACHER, COURSE_MATERIAL, and SUBJECT as shown below

DeSiamorePowered by DeSiaMore29 Relationships….

DeSiamorePowered by DeSiaMore30 Connectivity  Relationships can be classified as One-to-One One-to-Many and Many-to-Many  The term Connectivity is used to describe this relationship classification  E-R indicates the relationship’s connectivity by placing a 1, M or N near the related entities as shown below

DeSiamorePowered by DeSiaMore31 Connectivity…..  Example, the relationship are explained as follows; A MANAGER in the company manages a single DEPARTMENT (A One-to-One connectivity) A DEPARTMENT can have more than one EMPLOYEE (a One-to-Many connectivity) The training department of the company offers many courses to the employees as a part of the employee development program. Each EMPLOYEE can join for more than one COURSE (a many-to-many connectivity)

DeSiamorePowered by DeSiaMore32 Connectivity…..  (a) A One-to-One Relationship

DeSiamorePowered by DeSiaMore33 Connectivity…..  (b) a One-to-Many Relationship

DeSiamorePowered by DeSiaMore34 Connectivity…..  (c) A Many-to-Many Relationship

DeSiamorePowered by DeSiaMore35 Cardinality  Cardinality expresses the specific number of entity occurrences associated with one occurrence of the related entity  The actual number of associated entities is governed by the business rules

DeSiamorePowered by DeSiaMore36 Cardinality…..  Example, cardinality in Relationships  One department can have a maximum of 100 employees

DeSiamorePowered by DeSiaMore37 Cardinality…..  Example…cardinality in Relationships  Each employee is allowed to join a maximum of 2 courses at a time whilst a company offers 10 courses

DeSiamorePowered by DeSiaMore38 Dependency  Entities are classified as being strong or weak entity types  An entity type that is existence-dependent on some other entity is called a weak entity type or existence-dependent and  An entity type that is not existence-dependent on some other entity type is called a strong entity type  A weak entity type is dependent on the existence of another entity  Weak entities are also referred to as child, dependent or subordinate entities and strong entities as parent, owner or dominant entities

DeSiamorePowered by DeSiaMore39 Dependency…..  Example, in the following relationship PARENT is a weak entity as it needs the entity EMPLOYEE for its existence  The entities EMPLOYEE, COMPANY etc, are strong entities.  Refer the figure shown below

DeSiamorePowered by DeSiaMore40 Dependency…..  Example…

DeSiamorePowered by DeSiaMore41 Participation  There are two ways an entity can participate in a relationship as totally or partially.  The participation is also known as mandatory or optional.  The participation is total (mandatory) if an entity’s existence requires the existence of an associated entity in a particular relationship  The participation is said to be optional or partial, if the occurrence of one entity does not require the occurrence of another corresponding entity in a relationship

DeSiamorePowered by DeSiaMore42 Participation…..  Example, in the relationship “EMPLOYEE joins COURSE”, it is quite possible for an EMPLOYEE not to take a COURSE, therefore COURSE is optional to the EMPLOYEE,  But a COURSE must be attended by an EMPLOYEE which makes the EMPLOYEE a mandatory entity  An optional entity is shown by drawing a small circle (O) on the side of the optional entity as shown below

DeSiamorePowered by DeSiaMore43 Participation…..

DeSiamorePowered by DeSiaMore44 E-R Model..  Example of one-to-one Relationship between the entities EMPLOYEE and CONSULTANT. Here consultant is a special type of the entity EMPLOYEE –an ISA relationship Similarly, there are one-to-many and many-to-many relationships

DeSiamorePowered by DeSiaMore45 E-R Model..  Example…

DeSiamorePowered by DeSiaMore46 E-R Model..  Example, the relationship between EMPLOYEE and DEPARTMENT is one- to-many relationship (assuming that an employee works for only one department and a department can have more than one employee), as shown below

DeSiamorePowered by DeSiaMore47 E-R Model..

DeSiamorePowered by DeSiaMore48 E-R Model..  Example of the many-to-many relationship is the one between AUTHOR and PUBLISHER.  An author can have more than one publisher and a publisher will be publishing books of more than one author, as shown below

DeSiamorePowered by DeSiaMore49 E-R Model..

DeSiamorePowered by DeSiaMore50 E-R Model..  Example, consider a relationship between the EMPLOYEE and the CONSULTANT entities, CONSULTANT entity cannot exist without the EMPLOYEE, the EMPLOYEE can exist without the CONSULTANT  See the figure below

DeSiamorePowered by DeSiaMore51 E-R Model..

DeSiamorePowered by DeSiaMore52 E-R Model..  Now if we make up the entity lists of these entities can be written as EMPLOYEE (Emp_No., Name, Age, Sex, Salary ) CONSULTANT ( Emp_No., Client, Designation ) DEPARTMENT ( Dept_id.,name ) AUTHOR ( Name, Age, Sex, Address, Phone_No.) PUBLISHER ( Name, Address, Editor )

DeSiamorePowered by DeSiaMore53 Review Any Questions