Skip to main content

Database Models

We know that multiple related files are integrated together to form a database. A database model defines the manner in which the various files of database are linked together. A DBMS can take any one of the several approaches to manage the data. Each approach constitutes a database model. A data model is a collection of logical constructs used to represent data structure and relationships within the database. i.e description of data structures and their contained fields, together with operation or functions that manipulate them. A data model is a comprehensive scheme for describing how data is to be represented for manipulation. A database model can be organized as implementation models which emphasis on how the data are represented in the database.


The five commonly used database models are (they are also known as database structures or database structuring techniques):

1.      Hierarchical
2.      Network
3.      Relational
4.      Object-oriented
5.      Entity-relationship diagram

Hierarchical Model

In a hierarchical database, the data elements are linked in the form of an inverted tree structure with the root at the top and the branches formed below. Below the single-root data element are subordinate elements, each of which, in turn, has one or more elements. There is a parent-child relationship among the data elements of a hierarchical database. A parent data element is one that has one or more subordinate data elements. There may be many children

elements under each parent element, but there can be only one parent element for any child element. Note that branches in a tree structure are not connected.



                    
                                                                                                                                                                                                                 
FIGURE 1.6 An example of a hierarchical database.
                                                                                                                                                        


Advantages

1.      The hierarchical database structure has been used in a large number of database applications because the data elements of many applications can be neatly organized in the form of a hierarchical structure.
2.      Easily data sharing.
3.      More data security
4.      Data integrity
5.      Efficiency with 1:M relationship
6.      Ease-of-understanding

Dis-advantages

1.      The main limitation of a hierarchical database structure is that it does not support flexible data access because the data elements can be accessed only by following the path down the tree structure.
2.      Implementation complexity.
3.      Lack of structural independence.
4.      Difficult to implement M:N relationship.


Network Model

A network database structure is an extension of the hierarchical database structure. In this model also, the data elements of a database are organized in the form of parent-child relationships, and all types of relationships among the data elements must be determined when the database is first designed. In a network database, however, a child data element can have more than one parent element or no parent at all. Moreover in this type of database, the database management system permits the extraction of the needed information by beginning from any data element in the database structure instead of starting from the root data element.





FIGURE 1.7 An example of Network Model

To help establish database standards, the Conference on Data Systems Languages (CODASYL) created the Database Task Group (DBTG) in the late 1960s. The DBTG was charged to define standard specifications for an environment that would facilitate database creation and data manipulation.

The final DBTG report contained specifications for three crucial database components:

·   The network schema, the conceptual organization of the entire database as viewed by the database administrator. The schema includes a definition of the database name, the record type for each record, and the components that make up those records.

·   The network subschema, which defines the portion of the database “seen” by the application programmer that actually produce the desired information from the data contained within the database. The existence of subschema definitions allows all application programs to simply invoke the subschema required to access the appropriate database file(s).

·   A data management language (DML) that defines the environment in which data can be managed. To produce the desired standardization for each of the three components, the DBTG specified three distinct DML components:

-          A schema data definition language (DDL), which enables the database administrator to define the schema components.
-          A subschema DDL, which allows the application programs to define the database components that will be used by the application.
-          A data manipulation language to work with the data in the database.


Advantages

1.      Ease-of-data access.
2.      Data integrity and capability to handle more relationship types.
3.      Data independence.
4.      Conceptual simplicity.
5.      It includes DDL, DML .


Dis-advantages

1.      Operation and maintenance of the network model is expensive.
2.      Time consuming.
3.      Absence of structural independence.


Relational Model

It simplifies user’s view of database by using simple tables instead of more complex tree and network structure. In a relational database, the data elements are organized in the form of multiple tables with rows and columns. Each table of the database is stored as a separate file. Each table column represents a data field, and each row a data record (also known as a tuples). The data in one table (or file) is related to data in another table through the use of common field.




FIGURE 1.8 An example of relational database structure.

Advantages

1.      Structural independence.
2.      Ease-of-design, implementation, maintenance and usage.
3.      Ad-hoc query capability.
4.      Large storage capability.
5.      Data can be accessed directly without having to access all parent objects.

Dis-advantages

1.      Hardware and software overheads.
2.      It prompts islands of information problems as individual and departments can easily develop own applications.
3.      Ease-of-design can lead to bad design.


Object-Oriented Model

A database model that captures object-oriented concepts such as class hierarchy, inheritance, and methods is an object-oriented database model. It is a collection of objects whose behavior and state, and the relationships are defined in accordance with an object-oriented database model. An object-oriented database management system is one, which allows the definition and manipulation of an object-oriented database.



FIGURE 1.9 An example of object-oriented database

To illustrate the concept, let us consider an object representing a bank account. Such an object contains instance variables account number and balance. It contains a method pay-interest, which adds interest to the balance. Assume that the bank had been paying 6-percent interest on all accounts, but now is changing its policy to pay 5 percent if the balance is less than $1000 or 6 percent if the balance is $1000 or greater. Under most data models, making this adjustment would involve changing code in one or more application programs. Under the object-oriented model, the only change is made within the pay-interest method. The external interface to the objects remains unchanged.

Advantages

1.      Capability to handle large number of different data types like images, music…etc.
2.      Inheritance promotes data integrity.
3.      Improved data access.


Dis-advantages

1.      Difficult to maintain.
2.      High system overheads slow transaction.
3.      Not suited for all applications.


Entity-Relationship Model

The entity-relationship data model grew out of exercise of using commercially available DBMS to model application databases. Earlier commercial systems were based on the hierarchical and network approach. The entity-relationship model is a generalization of these models. It allows the representation of explicit constraints as well as relationships. Even though the E-R model has some means of describing the physical database model, it is basically useful in the design and communication of the logical database model. In this model, objects of similar structures are collected into an entity set. The relationship between entity sets is represented by a named E-R relationship and is 1:1, 1:M, or M:N, mapping from one entity set to another. The database structure, employing the E-R model is usually shown pictorially using entity-relationship diagrams. The overall logical structure of a database can be expressed graphically by an E-R diagram, which is built up from the following components:

·         Rectangles, which represents entity sets
·         Ellipses, which represent attributes
·         Diamonds, which represent relationships among entity sets
·         Lines, which link attributes to entity sets and entity sets to relationships.



FIGURE 1.10 Model’s of Chen and Crow’s Foot

Advantages

1.      Visual modeling yields exceptional conceptual simplicity.
2.      Visual representation makes it an effective communication tool.
3.      It is integrated with dominant relational model.

Disadvantages

1.      There is limited constraint representation.
2.      There is limited relationship representation.
3.      There is no data manipulation language.
4.      Loss of information content occurs when attributes are removed from entities to avoid crowded displays.




Comments

Popular posts from this blog

Characteristics of a Good Programming Language

Till now there are many high level languages which are very popular, and there are others, which could not become so popular in-spite of being very powerful. There might be many reasons for the success of a language, but one obvious reason is the characteristics of the language. Several characteristics believed to be important with respect to making a programming language good are briefly discussed below. Simplicity A good programming language must be simple and easy to learn and use. For example, BASIC is liked by many programmers only because of its simplicity. Thus, a good programming language should provide a programmer with a clear, simple and unified set of concepts which can be easily grasped. It is also easy to develop and implement a compiler or an interpreter for a programming language that is simple. However, the power needed for the language should not be sacrificed for simplicity. The overall simplicity of a programming language strongly affects the readability of the pr...

Angular 4 and Firebase Authentication: Setup

If you have come to this article, it means you are keen to learn new technology and that too Firebase. I love Firebase because it provides all basic but important features of any web application. Take for example, authentication, which is cumbersome and risky if not implemented with utmost care. And when we have the integration of Angular and Firebase, it becomes a lot easier for a developer to build such crucial modules in less time with minimal efforts. In this article we will create a simple Angular application using Firebase. I am going ahead with the understanding that you know the benefits of Firebase and have little knowledge about it. There are plenty of posts out on the web if you are behind. Step 1: Install Angular CLI (if not installed). npm install -g angular-cli Step 2: Create new Angular 4 project. By default now angular CLI will create Angular 4 project so you need not fret. ng new firebase-authentication Step 3: Check whether the ne...

Switch-case, simple calculator . . .

11.      Write a program to perform some mathematic functions with the help of “switch-case” statement. #include<stdio.h> #include<conio.h> void main() { int a,b,ans; char c; clrscr(); printf("\ Enter a and b:"); scanf("%d%d",&a,&b); printf("\n Enter operator:"); fflush(stdin); scanf("%c",&c); switch(c) { case'+':ans=a+b;       break; case'-':ans=a-b;       break; case'*':ans=a*b;       break; case'/':ans=a/b;       break; } printf("\n ans %d",ans); getch(); } 12.      Print the Fibonacci series #include<stdio.h> #include<conio.h> void main() { int a=1,b=1,s=3,c,ch; clrscr(); printf("how many steps="); scanf("%d",&ch); printf("%5d%5d",a,b); for(s=3;s<=ch;s++) {       c=a+b;       printf("%5d",c);       a=b;    ...