Hierarchical Model in DBMS

Hierarchical Model

A hierarchical database model is a data model in which data is organized into a tree-like structure, with each record (or “node”) having one parent record and zero or more child records. The parent-child relationship between records is represented by links, which are similar to pointers in programming languages.
Hierarchical Model in DBMS

Hierarchical model in DBMS

  • Hierarchical data model is being used from the 1960s onwards where data is organized like a tree structure
  • In 1966 IBM introduced an information management system(IMS product) which is based on this hierarchical data model but now it is rarely used.

Hierarchical model: 

The hierarchical model organizes the data into a tree structure which consist of a single root node where each record is having a parent record and many child records and expands like a tree

Hierarchical Model in DBMS img

Features of the hierarchical model 

  • A child node will have only one parent node
  • One to many relationship: Hierarchical model is implemented based on one to many relationship.Based on this any parent node should have more than one child nodes i.e one parent for many child.

 

Example for hierarchical model

  • Example of students and courses where a course can be assigned to a single student  where as student can take a number of courses hence one to many relationship is observed
  • Here the hierarchical data can be represented as relation tables considered as student table and one as courts table and the link between these two tables is maintained using a foreign key.

 

Drawbacks of the hierarchical model 

As we have used one to many relationship in data organization, child records may be repeated and sometimes we need to maintain empty child records which is a memory wastage.

 

Prime Course Trailer

Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others

Checkout list of all the video courses in PrepInsta Prime Subscription

Checkout list of all the video courses in PrepInsta Prime Subscription