Thursday, 9 June 2016

RECORD-BASED LOGICAL MODELS



Hierarchical model


In Hierarchical database data is organized into a tree-like structure, implying a single upward link in each record to describe the nesting, and a sort field to keep the records in a particular order in each same-level list. In the hierarchical model two main data structures concepts: record and parent child relationship.

Record: A collection of field or data items values that provide information on an entity. Each field has a certain data type such as integer, real or string. Record of the same type are grouped into record types.

Parent child relationship type (PCR): It is the 1:N relation between two record types. The record type 1side is parent record type and one on the N side is called child record type of the PCR type. An occurrence (or instance) of the PCR type consists on one record of the parent record type and a number of records (zero or more) of the child record types.

A hierarchical database schema consist number of hierarchical schemas and each hierarchical schema consists numbers of record type and PCR types.



                                                         Above  figure shows A Hierarchical Schema


A hierarchical schema is displayed as a hierarchical diagram.

  •  Record type names are displayed in rectangular boxes and 
  •  PCR types are displayed as lines connecting the parent record type to the child record type.

Properties of Hierarchical Schema


1. One record type, called the root of the hierarchical schema, does not participate as a child           record type in any  PCR type.

2. Every record type except the root participates as a child record type in exactly one PCR type.

3. A record type can participate as parent record type in any number (zero or more) of PCR           type.

4. A record type that does not participate as parent record type in any PCR type is called a leaf     of the hierarchical schema.

5. If a record type participates as parent record type in any PCR type, then it is child.


Advantages of Hierarchical Database


1. Simplicity: Data naturally have hierarchical relationship in most of the practical situations.       Therefore, it is easier to view data arranged in this manner. This makes, this type of database      more suitable for the purpose. The design process, consequently, is simple.

2. Security: These database systems can enforce varying degree of security features unlike flat-       file systems.

3. Database integrity: Because of its inherent parent-child structure, database integrity is highly     promoted in these systems.

4. Efficiency: For 1:M type relationships, these types of database are very efficient.


Disadvantages of Hierarchical Database


1. Complexity of implementation: The actual implementation of a hierarchical database                 depends on the physical storage of data. This makes the implementation complicated.

2. Difficulty in management: The movement of a data segment from one location to another           causes all the accessing programs to be modified making database management a complex         affair.

3. Structural Dependence: The database has a rigidly defined relationship and hence any                 change in any part of the structure of the database would require change in the programs           accessing it. This makes maintenance very difficult.

4. Complexity of programming: Programming a hierarchical database is relatively complex           because the programmers must know the physical path of the data items.

5. Poor portability: The database are not easily portable mainly because there is little or no             standard existing for these types of databases.