Careers and Jobs in India

Careers and Jobs in India

COMPUTER KNOWLEDGE FOR COMPETITIVE EXAMS (ER - MODAL)


In my last post i have discussed basic DBMS terminology now in this post i am going to discuss Entity relationship model. ER-modal related question asked in every IT exam and these are basic to understand database

Entity relationship model defines the conceptual view of database. It works around real world entity and association among them. At view level, ER model is considered well for designing databases.
Entity - A real-world thing that can be easily identifiable and distinguishable. For example, in a school database, student, teachers, class and course offered can be considered as entities.


Attributes - Entities are represented by means of their properties, called attributes. All attributes have values. For example, a student entity may have name, class, age as attributes.

TYPES OF ATTRIBUTES:

  1. Simple attribute - Simple attributes are atomic values, which cannot be divided further. For example, student's phone-number is an atomic value of 10 digits.
  2. Composite attribute - Composite attributes are made of more than one simple attribute. For example, a student's complete name may have first_name and last_name.
  3. Derived attribute - Derived attributes are attributes, which do not exist physical in the database, but there values are derived from other attributes presented in the database. For example, average_salary in a department should be saved in database instead it can be derived. For another example, age can be derived from data_of_birth.
  4. Single-valued attribute - Single valued attributes contain on single value. For example: Social_Security_Number.
  5. Multi-value attribute - Multi-value attribute may contain more than one values. For example, a person can have more than one phone numbers, email_addresses etc.


Relationship
- The association among entities is called relationship.
Relationships are represented by diamond shaped box. Name of the relationship is written in the diamond-box. All entities (rectangles), participating in relationship, are connected to it by a line.

BINARY RELATIONSHIP AND CARDINALITY

A relationship where two entities are participating, is called a binary relationship. Cardinality is the number of instance of an entity from a relation that can be associated with the relation.

  1. One-to-one When only one instance of entity is associated with the relationship, it is marked as '1'.
  2. One-to-many When more than one instance of entity is associated with the relationship, it is marked as 'N'.
  3. Many-to-one When more than one instance of entity is associated with the relationship, it is marked as 'N'.



PARTICIPATION CONSTRAINTS
  1. Total Participation: Each entity in the entity is involved in the relationship. Total participation is represented by double lines.
  2. Partial participation: Not all entities are involved in the relation ship. Partial participation is represented by single line.
ENTITY-SET AND KEYS

Key is an attribute or collection of attributes that uniquely identifies an entity among entity set. For example, roll_number of a student makes her/him identifiable among students.

  • Super Key: Set of attributes (one or more) that collectively identifies an entity in an entity set.
  • Candidate Key: Minimal super key is called candidate key that is, supers keys for which no proper subset are a superkey. An entity set may have more than one candidate key.
  • Primary Key: This is one of the candidate key chosen by the database designer to uniquely identify the entity set.


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 .In entity relationship diagrams a weak entity set is indicated by a bold (or double-lined) rectangle (the entity) connected by a bold (or double-lined) type arrow to a bold (or double-lined) diamond (the relationship).
In my next Post I am going to diccuss generalization and specialization.

Popular Posts