Topic Beyond Syllabus DBMS
Topic Beyond Syllabus DBMS
Hierarchical model
A hierarchical data model is a data model in which the data is organized into a tree- like structure. The structure
represents information using parent/child relationships. Each parent can have many children but each child only
has one parent. The hierarchical model was developed in the 1960s to manage large amounts of data. The
hierarchical structure consists of levels, or segments. The root segment is the parent of the level1 segments, which,
in turn, are the parents of the level2 segments, etc. In short, the hierarchical model depicts a set of one-to-
many(1:M) relation ships between a parent and its children segments.(Each parent can have many children, but
each child has only one parent).
Advantages
Promotes data sharing.
Conceptual simplicity.
Database security.
Data Independence.
Database integrity.
Efficient with 1:M relationships.
Disadvantages
Complex implementation.
Difficult to manage.
Structural dependency.
Applications programming and use complexity.
No support of DDL and DML.
Implimentation limitations i.e no M:N relationships.
Network model
In the Network Model, a parent can have several children and a child can also have many parent records. Records
are physically linked through pointers. The network model was created to represent complex relationships more
effectively than the Hierarchical model. This model was developed in the late 1960s. In the network model, the
user perceives the network database as a collection of records in 1:M relationships. In network database
terminology, a relationship is called a set. Each set is composed of at least two record types: a parent record and a
child record. A set represents a 1:M relationship between the parent and the child.
Example: The following diagram is an example for network Model.
Advantages:
Conceptual simplicity.
Handels more relationship types such as M:N
Data access flexibility.
Promotes database integrity.
Support of DDL and DML.
Disadvantages
System complexity.
Structural Dependency.
Complex Implementation.
Relational Model
The relational model was introduced in 1970 by E.F.Codd. In the Relational Model, all data is maintained in the
form of tables consisting of rows and columns. Data in two tables is related through common columns and not
through pointers. This makes Querying much easy in a Relational DBMS. Unlike the Hierarchical and Network
Models, there are no physical links in a relational model. The relationship type is often shown in a relational-
schema. A table yields complete data and structural independence.
Example: The following set of tables is an example for Relational Model.
Advantages:
Structural Independence
Improved conceptual simplicity
Easier database design, implementation, management, and use
Ad hoc Query capability(SQL).
Disadvantages:
Requires large hardware and system software overhead.
Possibility of poor design and implementation.
Object-based data mode: These models Represents the data in the form of objects. The object-
based data models are:
1. Object-oriented data model
2. Entity-relationship model.
Object-oriented data model: This model was introduced in 1990’s. In this model, the data is represented in the
form of objects. In this model we can store not only data but also procedures (methods). Object-oriented data
model is based on following components.
Object: Object is a real time entity that must be existing in the world.
Attribute: It describes the properties/characteristics of an object.
Ex: STUDENT object contains attributes like sno, name, marks, etc. Method: It is a set of instructions
that performs a specific task.
Representation of an object
Entity-Relationship model: Entity-Relationship model is graphical representation of entities, attributes and
relationship.
This model becomes very popular because it is easier to understand databases graphically than text.
ER model was introduced by “Peter Chen” in 1976.
ER model is based on the following components.
Entity: An entity is a person, place, object, event or concept in user’s environment, which we want to store in
database. It is represented in the ERD by a “rectangle”.
Attribute: It describes the properties/characteristics of an entity. It is represented by an “ellipse”.
Relationship: Relationship describes associations among data.
It is represented by a “ diamond”.
Functional Data Model: The functional data model makes it easier to define functions and call them
where ever necessary to process data.
Example: The following example shows a representation of the EMPLOYEE Supertype with its three
subtypes using EER-Notations. Consider the following entities set having the attributes.
Supertype: EMPLOYEE Emp_No, Emp_Name, Address.
Subtype: HOURLY_EMPLOYEE Emp_No, Emp_Name, Address, Hourly_Rate.
SALARY_EMPLOYEE Emp_No, Emp_Name, Address, Annual_Salary.
CONTRACT_EMPLOYEE Emp_No, Emp_Name, Address, Cont_Number,
Billing_Rate.
In that above all of the EMPLOYEE types several attributes in common namely Emp_No, Emp_Name,
Address. In addition each type has one are more attribute distinct from the attributes of the types.
In the above figure shows a representation of the EMPLOYEE Supertype with the 3 subtypes using EER-Notation.
Attributes shared by all employees are associated with the EMPLOYEE entity type. Attributes that are peculiar to
each subtype are included with that subtype only
What is EER(Enhanced Entity Relationship) model? Explain the basic concepts of EER model?
An entity type is a collection of entities that share common properties or characters. Some entities are almost same
but have few distinct attributes. For this reason E-R model has been extended to include supertype/subtype
relationships. The enhanced version of ERM is nothing but EERM.
Enhanced Entity Relationship Model(EERM): The model that has resulted from extending the original E-R
model with new modeling constructs. The new modeling constructs introduced in the EER model are supertype
(superclass)/ subtype (subclass) relationships.
The supertype allows us to model general entity type where as the subtype allows us to model specialized entity
types.
Enhanced ER model= ER model + hierarchical relationships.
The extended ER model extends the ER model to allow various types of abstraction to be included and to express
constraints more clearly.
Supertype: A generic entity type that has a relationship with one or more subtypes. It contains shared attributes.
For example PLAYER is a generic entity type which has a relationship with one or more subtypes like cricket
player, football player, hockey player etc.
Subtype: A sub-grouping of the entities in an entity type and that shares common attributes or relationships
distinct from other sub-groupings. It has only unique attributes.
Consider the entity type STUDENT, which has two sub types UNDERGRADUATE and POSTGRADUATE.
Example: Assume that an organization needs to store the details of different types of employees such as full time
Employee and Part time employee.
FULLTIME EMPLOYEE(Emp_num,Emp_Name,Address, Salary,HRA)
PARTTIME EMPLOYEE(Emp_num,Emo_Name,Address,Hourly_salary)
Notice that all of the employee types have several attributes is common, i.e Emp_num,Emp_Name, Address. In
Addition each type has one or more attributes distinct from the attributes of other types.
These types share some common properties such as Name, Employee number, Address .
Full time Employee has distinct attributes “salary” and “HRA”.
Par time Employee has a distinct attribute “Hourly_Salary”.
Now, let us draw EERM for EMPLOYEE super type with two sub types: “FULL TIME EMPLOYEE”,
“PARTTIME EMPLOYEE”.
In the above diagram shows the representation of the EMPLOYEE supertype with its two sub types,
FULLTIMEEMPLOYEE, PARTTIMEEMPLOYEE.
Thus, the new relations will be:
EMPLOYEE(Emp_Num,Emp_NAME,Address)
->FullTIME_EMPLOYEE(Emp_Num,Emp_Name, Address,Salary,HRA)
->PARTTIME_EMPLOYEE(Emp_Num,Emp_Name, Address, Hourly_Salary)
Specialization: Specialization is an object set that is a subset of another object set. This is a top-down process of
deriving child objects from a parent object.
Specialization is a process of defining one or more subtypes of the supertype.
It forms sub types from a super type.
Example: Assume that an organization needs to store the details of products as a PRODUCT entity. The ER model,
for the above, can be represented as shown below.
Some of the attributes show are not necessary when we go for sub types such as PURCHASED PRODUCT and
MANUFACTURED PRODUCT. Using Specialization technique, we can form two sub-types form PRODUCT
entity.
Let us draw EER model with super/subtype relationship for PRODUCT super type with two sub types:
PURCHASED PRODUCT and MANUFACTURED PRODUCT.
The correct model is possible by using ‘aggregate’ technique. It removes the redundant relationship and
aggregates the relationship ‘has’ along with its entities BRANCH and EMPLOYEE. This aggregation can now be
perceived as a new object set ‘BRANCHOFFICE’ and the correct relationship is ‘MANAGER’ MANAGES A
branch office. Here, the aggregation is shown by a thick box drawn around the aggregate and its objects.
Composition:
It is a specialized form of Aggregation. It is a strong type og Aggregation. In this relationship child objects
does not have their lifecycle without parent object. If a parent object is deleted, all its child objects will also be
deleted. This represents “death” relationship. This is represented by a solid diamond followed by a line.
Let’s take an example of relationship between House and rooms. House can contain multiple rooms there is no
dependent life of room and any room cannot belongs to two different house if we delete the house will
automatically delete.
Let’s take another example of relationship between Questions and options. Single questions can have
multiple options and option cannot belong to multiple questions. If we delete questions options will be
automatically deleted.