0% found this document useful (0 votes)
31 views2 pages

DB Relational Moedel Heirar

The document discusses two database models: the relational model and hierarchical model. The relational model organizes data into interrelated tables, with columns representing attributes and rows representing records. An example shows a Student table with attributes like student ID, name, and age, and a Course table with attributes like student ID, course ID, and course name. The hierarchical model structures data in a tree-like format, with each record having one parent and multiple children. An example shows how a hierarchical relationship of students taking courses can be represented using relational tables.

Uploaded by

technocomy2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views2 pages

DB Relational Moedel Heirar

The document discusses two database models: the relational model and hierarchical model. The relational model organizes data into interrelated tables, with columns representing attributes and rows representing records. An example shows a Student table with attributes like student ID, name, and age, and a Course table with attributes like student ID, course ID, and course name. The hierarchical model structures data in a tree-like format, with each record having one parent and multiple children. An example shows how a hierarchical relationship of students taking courses can be represented using relational tables.

Uploaded by

technocomy2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Relational model in DBMS

In relational model, the data and relationships are represented by collection of


inter-related tables. Each table is a group of column and rows, where column
represents attribute of an entity and rows represents records.

Sample relationship Model: Student table with 3 columns and four records.

Table: Student

Stu_Id Stu_Name Stu_Age


111 Ashish 23
123 Saurav 22
169 Lester 24
234 Lou 26
Table: Course

Stu_Id Course_Id Course_Name


111 C01 Science
111 C02 DBMS
169 C22 Java
169 C39 Computer Networks
Here Stu_Id, Stu_Name & Stu_Age are attributes of table Student and Stu_Id,
Course_Id & Course_Name are attributes of table Course. The rows with values
are the records (commonly known as tuples).

Hierarchical model in DBMS


In hierarchical model, data is organized into a tree like structure with each
record is having one parent record and many children. The main drawback of this
model is that, it can have only one to many relationships between nodes.

Note: Hierarchical models are rarely used now.

Sample Hierarchical Model Diagram:


Lets say we have few students and few courses and a course can be assigned to
a single student only, however a student take any number of courses so this
relationship becomes one to many.

Example of hierarchical data represented as relational tables: The above


hierarchical model can be represented as relational tables like this:

Stu_Id Stu_Name Stu_Age


123 Steve 29
367 Chaitanya 27
234 Ajeet 28
Course Table:

Course_Id Course_Name Stu_Id


C01 Cobol 123
C21 Java 367
C22 Perl 367
C33 JQuery 234

You might also like