You are on page 1of 5

S.

No. Hierarchical Data Model Network Data Model

In this model, you could create


In this model, to store data a network that shows how data
1. hierarchy method is used. is related to each other.

It implements 1:1, 1:n and also


2. It implements 1:1 and 1:n relations. many to many relations.

To organize records, it uses tree To organize records, it uses


3. structure. graphs.

Records are linked with the help of Records are linked with the
4. pointers. help of linked list.

Insertion anomaly exits in this


model i.e. child node cannot be
5. inserted without the parent node. There is no insertion anomaly.

Deletion anomaly exists in this


model i.e. it is difficult to delete the
6. parent node. There is no deletion anomaly.
GENERALIZATION SPECIALIZATION

Generalization works in Bottom-Up Specialization works in top-down


approach. approach.

In Generalization, size of schema gets In Specialization, size of schema gets


reduced. increased.

Generalization is normally applied to We can apply Specialization to a single


group of entities. entity.

Generalization can be defined as a Specialization can be defined as


process of creating groupings from process of creating subgrouping within
various entity sets an entity set

Specialization is reverse of
In Generalization process, what actually Generalization. Specialization is a
happens is that it takes the union of two process of taking a subset of a higher
or more lower-level entity sets to level entity set to form a lower-level
produce a higher-level entity sets. entity set.
S.NO Cursor Trigger

It is a pointer which is used to


control the context area and It is a program which gets
also to go through the records executed in response to
1. in the database. occurrence of some events.

A cursor can be created


within a trigger by writing the
declare statement inside the A trigger cannot be created
2. trigger. within a cursor.

It gets created in response to


execution of SQL statement
thus it is not previously It is a previously stored
3. stored. program.

The main function of the


cursor is retrieval of rows The main function of trigger is to
from the result set one at a maintain the integrity of the
4. time (row by row). database.
S.NO Cursor Trigger

A trigger is executed in
A cursor is activated and thus response to a DDL statement,
created in response to any DML statement or any database
5. SQL statement. operation.

S.NO Primary Key Candidate Key

Primary key is a minimal


super key. So there is one
and only one primary key in a While in a relation there can be
1. relation. more than one candidate key.

While in Candidate key any


Any attribute of Primary key attribute can contain NULL
2. can not contain NULL value. value.

Primary key can be optional But without candidate key there


3. to specify any relation. can’t be specified any relation.

Primary key specifies the Candidate specifies the key


important attribute for the which can qualify for primary
4. relation. key.

But Its not confirmed that a


Its confirmed that a primary candidate key can be a primary
5. key is a candidate key. key.

You might also like