Articles

Post Entity Relationship Diagram (ERD) – Part-I

In Database Systems on January 13, 2012 by Muhammad Haadi Tagged: , , , , , , ,

This topic has always been a challenge for me to discuss. It’s not that elaborating the concept among a bunch of students bothers me but the thing is that normally students get confused in the twists and turns this topic has.

However, I am going to keep things simple by using the divide and conquer approach, i-e. I will segregate the two main portions involved in this topic

  • the basics of ERD and
  • the one with relations explained

Therefore, that would make the concepts quite easy to understand and learn.

Note:There are various explanations of these concepts over the internet as some authors keep different concepts isolated to make them more understandable while others try not to indulge a newbie into the details. So, if you feel difficulty anywhere, feel free to ask.

Entity Relationship Diagram (ERD)

An Entity Relationship (ER) Diagram is a data modeling technique that illustrates the conceptual data model of an information system via relationships between entities.

Basic Constructs

  1. Entity: a place, event, concept or person etc.
  2. Attribute: characteristics that identify, classify, quantify or qualify an entity.
  3. Relationship: entity – relation (association) – entity

Mapping

  • Entity – table
  • Attribute – column
  • Relationship – foreign key

There isn’t much to explain about entities and attributes, rather relationships are the major concern; so we have to move on with them.

Classification of Relationships

  1. Degree of a Relationship
  2. Cardinality of a Relationship (it would be discussed in ERD Part – II)

Degree of a Relationship

Degree of a relationship is determined by the number of entities involved in that particular relationship.

These relationships are known as

  1. Unary
  2. Binary
  3. Ternary

Unary (Recursive)

A unary relationship involves the relationship of an entity with itself. It is also known as recursive relationship.

Figure – I unary relation

Manager manages employees; i-e a manager himself is an employee who manages other employees.

Binary

The relationship involving two entities is a binary relationship.

Figure – II binary relation

A student may study many courses or a course may be studied by many students.

Ternary

This type of relationship involves 3 entities in it. It must fulfill the following conditions:

  • One relation for each entity and one for the associative entity.
  • Associative entity has foreign keys for each entity in the relationship.
Figure – III ternary relation

This relation has a Physician entity that stores the details of the physician; a Patient entity that stores the facts about the patients and a Treatment entity that has the information about the treatment of the patient. While the Patient_Treatment entity is the one that contains the detailed summary of the whole visit, i-e patient details, the physician that treated him and the treatment that was given to him.

One may say that it is an extra entity but just to understand, it is like the prescription. Now you can well imagine that a prescription has all the details in it, about the physician, patient and the treatment given.

Cont’d…

Advertisements

13 Responses to “Post Entity Relationship Diagram (ERD) – Part-I”

  1. very nice post haadi. very appriciative 🙂
    keep it up buddy.

  2. you really rock ..well, its gr8 one. keep it up plz. 🙂

  3. good job Haadi

  4. Bhai m late !! but all is good enough 🙂 appriciable 🙂

  5. Have you ever considered about adding a little
    bit more than just your articles? I mean, what you say is important and
    all. Nevertheless just imagine if you added some great photos or videos to give your
    posts more, “pop”! Your content is excellent
    but with images and videos, this blog could certainly be one of the greatest in its field.
    Excellent blog!

    • Thanks a lot for your valuable feedback. I would definitely consider these suggestions in the upcoming articles. These were the articles I wrote some time ago when I was still enrolled in my Bachelors. Now, I don’t get much time to do this stuff due to my job but I would shortly start working on this again. Will update my blog pretty soon, you’ll get the notification if you subscribe to the blog.

      Cheers,
      haadi

  6. Your mode of explaining all in this piece of writing is really nice,
    all can effortlessly understand it, Thanks a lot.

  7. Write more, thats all I have to say. Literally, it seems as though
    you relied on the video to make your point. You clearly know what youre talking about, why
    waste your intelligence on just posting videos to your weblog when you could be giving us something enlightening to read?

  8. I visit daily a few sites and websites to read content, except this blog presents quality based content.

  9. Hi there! This is my 1st comment here so I just wanted to give a quick shout
    out and say I genuinely enjoy reading through your posts.

    Can you recommend any other blogs/websites/forums that cover the same subjects?

    Thank you so much!

  10. magnificent points altogether, you simply won a new reader.
    What may you suggest about your put up that you made some days in the past?
    Any sure?

  11. you are truly a just right webmaster. The site loading velocity is amazing.

    It kind of feels that you’re doing any unique trick.
    In addition, The contents are masterpiece.you’ve performed a excellent task in this matter!

  12. Ι’m really impressed witɦ your writing skills and also with thе layout on your weblog.
    Is thiѕ a paid theme or did you customize it yourself?
    Either way keep up the excellent quality writing, it is rаre
    to see a great blog like this one nowadays.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: