Entity-Relationship Model

Slides:



Advertisements
Similar presentations
Convert ER to Relational Database Entity relation Entity relation Attributes attributes Attributes attributes Primary key primary key Primary key primary.
Advertisements

The Entity-Relationship (ER) Model
The Entity-Relationship Model Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY courtesy of Joe Hellerstein for some slides.
Text-Book Chapters (7 and 8) Entity-Relationship Model
Introduction to Relational Database ISYS 464. Introduction to Relational Model Data is logically structured within relations. Each relation is a table.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
Chapter 2: Entity-Relationship Model (Continued)
© 2007 by Prentice Hall (Hoffer, Prescott & McFadden) 1 Entity Relationship Diagrams (ERDs)
Chapter 3: Modeling Data in the Organization
Entity-Relationship Model
Chapter 3: Relational Model  Structure of Relational Databases  Normal forms (chap. 7)  Reduction of an E-R Schema to Relational (Sect. 2.9)  Relational.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 2: Modeling Data in the Organization.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Entity-Relationship.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts DB Schema Design: the Entity-Relationship Model What’s the use of the E-R model? Entity Sets.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Chapter 2 : Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of.
Database Management Systems MIT Lesson 02 – Database Design (Entity Relationship Diagram) By S. Sabraz Nawaz.
 Entity-relationship models (ERM) Entity-relationship models (ERM)  Simple E-R Diagram Simple E-R Diagram  Weak Entity Weak Entity  Strong Entity.
Chapter 3 Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Entity Relationship Diagram (2)
UNIT_2 1 DATABASE MANAGEMENT SYSTEM[DBMS] [Unit: 2] Prepared By Lavlesh Pandit SPCE MCA, Visnagar.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan Lecture-03 Introduction –Data Models Lectured by, Jesmin Akhter.
ICOM 5016 – Introduction to Database Systems Lecture 5 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
Computing & Information Sciences Kansas State University Friday, 26 Sep 2008CIS 560: Database System Concepts Lecture 13 of 42 Friday, 26 September 2008.
The Entity-Relationship (ER) Model. Overview of db design Requirement analysis – Data to be stored – Applications to be built – Operations (most frequent)
CST203-2 Database Management Systems Lecture 4. Student entity NIDFNameLNameRegNoExamIdBirthdate.
©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.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts - 6 th Edition Chapter 7: Entity-Relationship Model.
Mapping ER to Relational Model Each strong entity set becomes a table. Each weak entity set also becomes a table by adding primary key of owner entity.
Topic 3: ER – Entity Relationship Model (ERM) 6/12/
ER Diagrams and Relational Model CS 174a (Winter 2015)
Entity-Relationship Data Model
Chapter 2: Entity-Relationship Model
Entity Relationship (E-R) Model
COP Introduction to Database Structures
Lecture 5 Supplement – ER Model & Mapping to Relational Model
Contents Design Process Modeling Constraints E-R Diagram Design Issues
Business System Development
Entity-Relationship Model
Database Constraints Ashima Wadhwa.
Entity-Relationship Model
Entity Relationship Model
Entity-Relationship Model
Chapter 2: Entity-Relationship Model
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
Chapter 7: Entity-Relationship Model
Chapter 7: Entity-Relationship Model
Chapter 7 Entity-Relationship Model
Outline of the ER Model By S.Saha
Entity/Relationship Model
Chapter 6: Entity-Relationship Model
Chapter 2: Entity-Relationship Model
Module 8 – Database Design Using the E-R Model
Entity-Relationship Model
Session 2 Welcome: The seventh learning sequence
The Entity-Relationship Model
Entity Relationship Model
Session 2 Welcome: The fifth learning sequence
Chapter 6: Entity-Relationship Model
Chapter 7: Entity-Relationship Model
Weak Entity Sets An entity set that does not have a primary key is referred to as a weak entity set. The existence of a weak entity set depends on the.
Chapter 7: Entity-Relationship Model
Entity-Relationship Diagram (ERD)
Mapping an ERD to a Relational Database
Entity Relation Model Tingting Zhang.
Chapter 2: Entity-Relationship Model
Entity-Relationship Data Model
Chapter 6b: Database Design Using the E-R Model
Presentation transcript:

Entity-Relationship Model

Degree of a Relationship Set Refers to number of entity sets that participate in a relationship set. Relationship sets that involve two entity sets are binary (or degree two). Generally, most relationship sets in a database system are binary. Entity Relationship Modelling

Descriptive Attribute Used to record information about relationship rather than about participating entities. Eg: sunil works in HR department since 2010. since is attribute of relationship works_in Entity Relationship Modelling

Binary Relationship set Entity Relationship Modelling

Ternary relationship set Entity Relationship Modelling

Total and partial participation consider a relationship set "Manages" which associates departments with employees. If a department cannot have more than one manager, this is an example of a one-to-many relationship set (it may be that an individual manages multiple departments). Entity Relationship Modelling

Entity Relationship Modelling an individual manages multiple departments Each employee works in at least one department and each department has at least one employee. Participation of both entities in works relationship is total Entity Relationship Modelling

Entity Relationship Modelling The participation of entity set employee in relationship ‘Manages’ is partial – Not every employee can become manager. Represent a total participation constraint by using a thick line. Entity Relationship Modelling

Entity Relationship Modelling

Entity Relationship Modelling Weak Entity Sets An entity set that does not have a primary key is referred to as a weak entity set. The existence of a weak entity set depends on the existence of a identifying entity set Identifying relationship depicted using a double diamond Entity Relationship Modelling

Entity Relationship Modelling The discriminator (or partial key) of a weak entity set is the set of attributes that distinguishes among all the entities of a weak entity set. The primary key of a weak entity set is formed by the primary key of the strong entity set on which the weak entity set is existence dependent, plus the weak entity set’s discriminator. Entity Relationship Modelling

Entity Relationship Modelling

Entity Relationship Modelling Keys Employee table: Employee ( Employee ID, FullName, SSN, DeptID ) Super Key: If you add any other column/attribute to a Primary Key then it become a super key, like EmployeeID + FullName is a Super Key. a set of attributes collectively identify an entity in the entity set uniquely Entity Relationship Modelling

Entity Relationship Modelling 2. Candidate Key: are individual columns in a table that qualifies for uniqueness of all the rows. Here in Employee table EmployeeID & SSN are Candidate keys. It is minimal super key Entity Relationship Modelling

Entity Relationship Modelling 3. Primary Key: is the columns you choose to maintain uniqueness in a table. Here in Employee table you can choose either EmployeeID or SSN columns, EmployeeID is preferable choice, as SSN is a secure value. 4. Alternate Key: Candidate column other the Primary column, like if EmployeeID is PK then SSN would be the Alternate key. Entity Relationship Modelling

Entity Relationship Modelling 5. Composite Key: If a table do not have any single column that qualifies for a Candidate key, then you have to select 2 or more columns to make a row unique. Like if there is no EmployeeID or SSN columns, then you can make FullName + DateOfBirth as Composite primary Key. But still there can be a narrow chance of duplicate row. Candidate key with one attribute- simple attribute Candidate key with more than one attribute- composite attribute Entity Relationship Modelling

Entity Relationship Modelling Extended ER Features Generalization is a bottom-up approach in which two lower level entities combine to form a higher level entity. In generalization, the higher level entity can also combine with other lower level entity to make further higher level entity Entity Relationship Modelling

Entity Relationship Modelling Specialization Specialization is opposite to Generalization. It is a top-down approach in which one higher level entity can be broken down into two lower level entity. In specialization, some higher level entities may not have lower-level entity sets at all. Entity Relationship Modelling

Another way of representation Entity Relationship Modelling

Entity Relationship Modelling Aggregation Aggregation is a process when relation between two entity is treated as a single entity. Here the relation between Center and Course, is acting as an Entity in relation with Visitor. Entity Relationship Modelling

Entity Relationship Modelling