sign in
 
   
 
 
 
  THE RELATIONAL MODEL  
   
 
A model in database system basically defines the structure or organization of data and a set of operations on that data.
 
 
In Relational Model database is represented as a collection of “Relations”, where each relation is represented by a two dimensional table.
 
 
ROLL NO
NAME
AGE
ADDRESS
1
Sanjay Prasad
35
B-4, Modi Nagar
2
Sharad Gupta
30
Pocket 2, Mayur Vihar
3
Vibhu Datt
36
C-2, New Delhi
 
 
Sample STUDENT Relation
 
  Advantages of relational model:  
 
*
Ease of use
 
The simple tabular representation of database helps the user to define and query the database conveniently.
*
Flexibility
 
Since the database is a collection of tables, new data can be added and deleted easily. Also, manipulation of data from various tables can be done easily using various basic operations.
*
Accuracy
 
In relational databases the relational algebraic operations are used to manipulate database. These are mathematical operations and ensure accuracy as compared to other models.
 
   
  ENTITY  
 
An entity is a ‘thing’ or ‘object’ in the real world that is distinguishable from all other objects.
Eg:- car, table, book, etc.

An entity has a set of properties and the values for some of properties may uniquely identify an entity.

An entity need not be a physical entity, it can also represent a concept in real world.
Eg:- project, loan, etc.

It represents a class of things, not any one instance.
Eg:- ‘STUDENT’ entity has instances of ‘Ramesh’ and ‘Mohan’.

 
     
  ENTITY SET OR ENTITY TYPE  
  A collection of a similar kind of entities, that share the same properties or attributes, is called an Entity Set or Entity Type.  
 
Database Entities
COLLEGE STUDENT
  FACULTY
  COURSE
  DEPARTMENT
 
 


The collections of all the students entities form an entity set STUDENT and the collection of all the courses form another entity set COURSE.

Entity set need not be disjoint.
For example, it is possible to define an entity set PERSON which contains the STUDENT entity, the FACULTY entity, both or neither.

 
   
   
 
 
   
  ATTRIBUTE  
 
An attribute is a property used to describe the specific feature of the entity. So to describe an entity entirely, a set of attributes are used.
For example, a student entity may be described by the student’s rollno, name, age, address, course, etc.

An entity will have a value for each of its attribute.

 
  DOMAIN  
 
Each simple attribute of an entity type contains a possible set of values that can be attached to it. A domain is a set of permissible values that can be given to an attribute. An attribute can not contain a value outside this domain.
 
 
TYPES OF ATTRIBUTES

SIMPLE ATTRIBUTE
An attribute that can not be further divided into smaller parts and represents the basic meaning is called a simple attribute.
For example, ‘First Name’, ‘Last Name’, ‘Age’ attributes of a STUDENT entity represent a simple attribute .

COMPOSITE ATTRIBUTE
An attribute that can be further divided into smaller units and each individual unit contains a specific meaning.
For example, The Name attribute of STUDENT entity can be sub-divided into First Name, Last Name and Middle Name.

SINGLE VALUED ATTRIBUTE
Attributes having a single value for a particular entity.
For example, Age is a single valued attribute of a STUDENT entity.

MULTI VALUED ATTRIBUTE
Attributes that have more than one values for a particular entity is called a multi valued attribute. Different entities may have different number of values for these kinds of attributes.
For example, Phone Number attribute for a STUDENT entity may be a multi valued attribute.

STORED ATTRIBUTE
Attributes that are directly stored in the database are called stored attributes.
For example, Birth Date attribute of a STUDENT entity.

DERIVED ATTRIBUTE
Attributes that are not stored directly but can be derived from stored attributes are called derived attribute.
For example, The Age of a STUDENT entity can be derived from the current date and the Birth Date of the student.
Similarly Total Salary of a PERSON entity can be derived from Basic Salary and Provident Fund, etc.

STRONG ENTITY SETS
An entity set containing a key attribute are called strong entity types or regular entity types.
For example, The STUDENT entity has a key attribute Roll No which uniquely identifies it, hence is a strong entity set.

WEAK ENTITY SETS
An entity set may not have sufficient attribute to form a primary key. Entity types that do not contain any key attributes, and hence can not be identified independently are called weak entity sets.

A weak entity can be identified uniquely only by considering some of its attributes in conjunction with the primary key attribute of another entity, which is called the identifying owner entity.