Thursday 25 February 2016

DATABASE DESIGN USING ER MODELS


The entity relationship model (or ER model) is a way to represent data in a database, and how different data is related to each other. It is one of the first steps to create a database.

Using ER diagrams simplifies the database design process, and involved the least technicalities.

It is used to create a blueprint of the database from the requirements of the client.  

The ER model was first proposed by Peter Pin-Shan Chen of Massachusetts Institute of Technology(MIT).

BUILDING BLOCKS OF ER MODELS

1.Entity: 
Entity is a collection of same type of data. For example, in a school collection of names of all the students is an entity.

Therefore, entities are nothing but set of data of same type.

While designing ER diagrams, we usually take all the common nouns as entities.

Example: Suppose we have to design a university database. The entities required may be:
  • Students
  • Teachers
  • Courses
  • Departments
....and so on

2.Attribute:
Every entity is a common noun. And common nouns are nothing but set of real life objects. Every real life objects has some properties, for example: A car is an object(or entity, or common noun, anything that floats your boat ;) ). A car has following properties:
  • Registration Number
  • Number Place
  • Model Name
  • Car manufacturer
Therefore all of above are Attributes of the entity CAR

3.Relationship:
As in INTRODUCTION TO DATABASES, I've discussed that database is a collection of related data, and what exactly do we mean by 'related'.

In ER modelling, we determine all the verbs involved in the requirement of the client and make them as relationships.
Example: According to client following are the requirements:

  • Entity STUDENTS
  • Entity TEACHER
  • TEACHER teaches STUDENTS

Therefore, here, TEACHES is a relationship




No comments:

Post a Comment