0
ENTITY RELATIONSHIP DIAGRAM BY MEER SADAF NAEEM
Part-1 Understanding the Fundamentals
BASIC CONCEPTS
WHAT IS ENTITY? <ul><li>Person  </li></ul>
WHAT IS ENTITY? <ul><li>Place </li></ul>
WHAT IS ENTITY? <ul><li>Object </li></ul>
WHAT IS ENTITY? <ul><li>Event   </li></ul>
ATTRIBUTES Descriptive properties possessed by each member of an entity set. Student Name   Address Class Roll number Perc...
ENTITY SET/TYPE: Student A Student B Student C Student D ENTITY SET : STUDENT <ul><li>Set of entities of the same type tha...
STUDENT A STUDENT B STUDENT C STUDENT D Mr. A Mr.D Mr. C Mr. B ENTITY SET : STUDENT  ENTITY SET : TEACHER
What is relationship? <ul><li>Meaningful association among several entities. </li></ul>
RELATIONSHIP SET/TYPE: A set of relationships of the same type.
Student A Student C Student B Mr. C Mr. B Mr. A ENTITY SET : STUDENT  ENTITY SET : TEACHER  RELATIONSHIP SET : SUBJECT
DEGREE OF RELATIONSHIP SET The number of entity sets that participate in a relationship set.
Student A Student C Student B Mr. C Mr. B Mr. A ENTITY SET : STUDENT  ENTITY SET : TEACHER  RELATIONSHIP SET : SUBJECT
TYPES OF ATTRIBUTES   <ul><li>Single and composite: </li></ul><ul><ul><ul><li>roll number is an example of  single attribu...
TYPES OF ATTRIBUTES <ul><li>Single valued and multivalued: </li></ul><ul><ul><ul><ul><li>The attributes which have single ...
TYPES OF ATTRIBUTES <ul><li>Derived attribute: </li></ul><ul><ul><ul><ul><li>These attributes are derived from the existin...
Student Name   Address Class Roll number Date-of-birth
TYPES OF ATTRIBUTES <ul><li>Descriptive attribute: </li></ul><ul><ul><ul><ul><li>The attribute of the relationship is call...
Cardinality   <ul><li>One to many </li></ul><ul><li>Many to one </li></ul><ul><li>One to one </li></ul><ul><li>Many to man...
ONE TO MANY A B a1 a4 a2 a3 b4 b3 b2 b1
MANY TO ONE   A B b2 a1 a2 a5 b3 b2 b1 a3 a4
ONE TO ONE   A B a1 a2 a3 a4 b4 b3 b2 b1
MANY TO MANY A B a1 a3 a2 b4 b3 b2 b1 a4
ROLE <ul><li>Not specified when entity sets that participate in a relationship set are distinct. </li></ul><ul><li>Clarifi...
RECURSIVE RELATIONSHIP <ul><li>When entities are self-linked then such a relationship is called a recursive relationship. ...
TOTAL PARTICIPATION <ul><li>The participation of an entity set E in a relationship set R is said to be TOTAL if every enti...
Student A Student C Student B Mr. C Mr. B Mr. A ENTITY SET : STUDENT  ENTITY SET : TEACHER  RELATIONSHIP SET : SUBJECT
PARTIAL PARTICIPATION <ul><li>The participation an entity set E in a relationship set R is said to be PARTIAL if only some...
MR.A MR.C MR.D MR.B CALCULUS JAVA DBMS FACULTY COURSES RELATIONSHIP SET:COURSE
Design issues  <ul><li>Example : should location be an entity or attribute? </li></ul><ul><li>Can a project be in more tha...
Weak entity set <ul><li>Existence of weak entity set depends on the existence of a strong entity set which is called the i...
Part-2 Introducing to Identifiers
Identifiers <ul><li>Candidate Key </li></ul><ul><ul><li>All available  unique ,  required  identifiers of an entity </li><...
Primary Key <ul><li>Natural primary key: </li></ul><ul><li>A natural primary key is one that exists in the data itself. </...
Why is it important to identify primary key? <ul><li>The primary key is the main “Handle” that the database server uses to...
Foreign Key <ul><li>A  primary key of one table that is included in another table. </li></ul><ul><li>Links the records in ...
 
Upcoming SlideShare
Loading in...5
×

Entity Relationship Diagram2

13,309

Published on

This presentation was created by me for Database subject. it described the whole process of creating ERD i.e. entity relationship diagrams

Published in: Health & Medicine, Technology
3 Comments
5 Likes
Statistics
Notes
No Downloads
Views
Total Views
13,309
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
768
Comments
3
Likes
5
Embeds 0
No embeds

No notes for slide

Transcript of "Entity Relationship Diagram2"

  1. 1. ENTITY RELATIONSHIP DIAGRAM BY MEER SADAF NAEEM
  2. 2. Part-1 Understanding the Fundamentals
  3. 3. BASIC CONCEPTS
  4. 4. WHAT IS ENTITY? <ul><li>Person </li></ul>
  5. 5. WHAT IS ENTITY? <ul><li>Place </li></ul>
  6. 6. WHAT IS ENTITY? <ul><li>Object </li></ul>
  7. 7. WHAT IS ENTITY? <ul><li>Event </li></ul>
  8. 8. ATTRIBUTES Descriptive properties possessed by each member of an entity set. Student Name Address Class Roll number Percentage
  9. 9. ENTITY SET/TYPE: Student A Student B Student C Student D ENTITY SET : STUDENT <ul><li>Set of entities of the same type that share the same attributes. </li></ul>
  10. 10. STUDENT A STUDENT B STUDENT C STUDENT D Mr. A Mr.D Mr. C Mr. B ENTITY SET : STUDENT ENTITY SET : TEACHER
  11. 11. What is relationship? <ul><li>Meaningful association among several entities. </li></ul>
  12. 12. RELATIONSHIP SET/TYPE: A set of relationships of the same type.
  13. 13. Student A Student C Student B Mr. C Mr. B Mr. A ENTITY SET : STUDENT ENTITY SET : TEACHER RELATIONSHIP SET : SUBJECT
  14. 14. DEGREE OF RELATIONSHIP SET The number of entity sets that participate in a relationship set.
  15. 15. Student A Student C Student B Mr. C Mr. B Mr. A ENTITY SET : STUDENT ENTITY SET : TEACHER RELATIONSHIP SET : SUBJECT
  16. 16. TYPES OF ATTRIBUTES <ul><li>Single and composite: </li></ul><ul><ul><ul><li>roll number is an example of single attribute as it can not be divided further. </li></ul></ul></ul><ul><ul><ul><li>Name can be divided further into 3 parts consisting of first name , middle name , last name so it is an example of composite attribute . </li></ul></ul></ul>
  17. 17. TYPES OF ATTRIBUTES <ul><li>Single valued and multivalued: </li></ul><ul><ul><ul><ul><li>The attributes which have single value are single valued attributes such roll number. </li></ul></ul></ul></ul><ul><ul><ul><ul><li>The attributes which has a set of values are called multivalued attributes . Such as any student can have more than 1 telephone number . </li></ul></ul></ul></ul>
  18. 18. TYPES OF ATTRIBUTES <ul><li>Derived attribute: </li></ul><ul><ul><ul><ul><li>These attributes are derived from the existing attributes of entities. </li></ul></ul></ul></ul><ul><ul><ul><ul><li>The value of a derived attribute is not stored , but computed when required. </li></ul></ul></ul></ul>
  19. 19. Student Name Address Class Roll number Date-of-birth
  20. 20. TYPES OF ATTRIBUTES <ul><li>Descriptive attribute: </li></ul><ul><ul><ul><ul><li>The attribute of the relationship is called descriptive attribute. </li></ul></ul></ul></ul>
  21. 21. Cardinality <ul><li>One to many </li></ul><ul><li>Many to one </li></ul><ul><li>One to one </li></ul><ul><li>Many to many </li></ul><ul><li>It expresses the number of entities to which another entity can be associated via a relationship set. </li></ul>
  22. 22. ONE TO MANY A B a1 a4 a2 a3 b4 b3 b2 b1
  23. 23. MANY TO ONE A B b2 a1 a2 a5 b3 b2 b1 a3 a4
  24. 24. ONE TO ONE A B a1 a2 a3 a4 b4 b3 b2 b1
  25. 25. MANY TO MANY A B a1 a3 a2 b4 b3 b2 b1 a4
  26. 26. ROLE <ul><li>Not specified when entity sets that participate in a relationship set are distinct. </li></ul><ul><li>Clarification is needed only when the entity sets of a relationship set are not distinct. </li></ul>The function that an entity plays in a relationship is called that entity’s role.
  27. 27. RECURSIVE RELATIONSHIP <ul><li>When entities are self-linked then such a relationship is called a recursive relationship. </li></ul>
  28. 28. TOTAL PARTICIPATION <ul><li>The participation of an entity set E in a relationship set R is said to be TOTAL if every entity in E participates in at least one relationship in R. </li></ul>
  29. 29. Student A Student C Student B Mr. C Mr. B Mr. A ENTITY SET : STUDENT ENTITY SET : TEACHER RELATIONSHIP SET : SUBJECT
  30. 30. PARTIAL PARTICIPATION <ul><li>The participation an entity set E in a relationship set R is said to be PARTIAL if only some entities in E participate in relationships in R. </li></ul>
  31. 31. MR.A MR.C MR.D MR.B CALCULUS JAVA DBMS FACULTY COURSES RELATIONSHIP SET:COURSE
  32. 32. Design issues <ul><li>Example : should location be an entity or attribute? </li></ul><ul><li>Can a project be in more than one location? </li></ul><ul><li>Does location need to be described in more detail? </li></ul>
  33. 33. Weak entity set <ul><li>Existence of weak entity set depends on the existence of a strong entity set which is called the identifying entity set. </li></ul><ul><li>The relationship is always many-to-one from weak to identifying. </li></ul><ul><li>Participation of the weak entity set in the relationship must be total. </li></ul>An entity set that does not have sufficient attributes to form a primary key is referred to as a weak entity set.
  34. 34. Part-2 Introducing to Identifiers
  35. 35. Identifiers <ul><li>Candidate Key </li></ul><ul><ul><li>All available unique , required identifiers of an entity </li></ul></ul><ul><li>Primary Key </li></ul><ul><ul><li>A unique, required identifier of an entity </li></ul></ul><ul><ul><li>The best one of candidate keys </li></ul></ul><ul><li>Foreign Key </li></ul><ul><ul><li>A reference key to another entity </li></ul></ul><ul><ul><li>This key is the primary key of another entity </li></ul></ul>
  36. 36. Primary Key <ul><li>Natural primary key: </li></ul><ul><li>A natural primary key is one that exists in the data itself. </li></ul><ul><li>Surrogate primary key: </li></ul><ul><li>The primary key that you have created where non existed before. </li></ul><ul><li>Primary key requires the consideration not just of the current data, but of possible future data as well. </li></ul>
  37. 37. Why is it important to identify primary key? <ul><li>The primary key is the main “Handle” that the database server uses to grab the information in which you are interested. </li></ul><ul><li>By identifying a primary key, you are telling the server which information you want to work with at the moment. </li></ul>
  38. 38. Foreign Key <ul><li>A primary key of one table that is included in another table. </li></ul><ul><li>Links the records in one database table to another table. </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×