What is data?

  • Data are the raw facts or static value that is obtained after experiment or calculations or     observations. 

  • Data refers to all the single items that are stored in a database, either individually or as a set. 

  • Data would be nothing if there is not given context. For eg. If I told you "10,12,13" only then you would learned nothing. But If I told "10,12,13" are the roll numbers of class 12 students who didn't pay fee then it is meaningful. 

  • Data itself do not provide any meaning but after processing it becomes information. Name of a student, age, class and her subjects can be counted as data for recording purposes. Mostly data represents recordable facts. For example, if we have data about marks obtained by all students, we can then conclude about toppers and average marks etc. 

  • Data can be quantitative or qualitative. Quantitative data is numeric, the result of a measurement, count, or some other mathematical calculation. Qualitative data is descriptive and may be numeric too. "Nepal" is the country of the tallest mountain in the World. This is qualitative data. Nepal has the total population of 29,041,684. This is the example of Quantitative data.


What is database?


  • Database is a systematic collection of data that is specially organized for rapid search and retrieval by a computer. 
  • Queries are the main way users retrieve database information.
  • Database support storage and manipulation of data.  Example- Let's consider the Facebook. It needs to store, manipulate and present data related to members, their friends, member activities, messages, advertisements and lot more.



fig. Symbol of Database



Types of database Model or Data Model:

Several different types of DBMS have been developed to support various requirements: flat, hierarchical, network, relational, and object-oriented.




  1. Flat Database: In flat databases, records are organized according to a simple list of entities separated by vertical bar(|) as below: 
Example: EMP No, Name, Age, Department, Salary |1,Alex,26,Store,5000 |2, Golith,32,Marketing,5600 | 3,Rabin,31,Marketing,6000.

Drawback:
  • There may be repeated data which can increase the file size.
  • The computer has more data to read through, so accessing and searching through them can be slow.



 
    2.  Hierarchical Database: 


 It is one of the oldest database model defined in late 1950s by IBM.
The records in hierarchical databases are organized in a treelike structure.

Advantages
  • Simplicity:  Since the database is based on the hierarchical structure, the relationship between the various layers is logically simple.

  • Data sharing: Since all data are held in a common database hence the data sharing becomes practical.



  • Data Security: Hierarchical model was the first database model that offered the data security that is provided by the DBMS.



  • Data Integrity: The word integrity refers to the no modification on data. Since it is based on the parent child relationship, there is always a link between the parent segment and the child segment under it.



  • Efficiency: It is very efficient because when the database contains a large number of one-to-many (1:N) relationship and when the user require large number of transaction.


Disadvantages  

  • Implementation complexity: Although it is simple and easy to design, it is quite complex to implement.



  • Inflexibility: The changes on new relation or segments often yield very complex system management task. A deletion of one segment may lead to the deletion of all segments under it.



  • Database Management Problem: If you make any changes in the database structure, then you need to make changes in the entire application program that access the database.



  • Lack of Structural Independence: there is lack of structural independence because when we change the structure then it becomes compulsory to change the application too. 

  • Operational Anomalies: Hierarchical model suffers from the insert, delete and update anomalies, also retrieval operation is difficult. So this model is not suitable for all cases. 



  • No standards: This model have not any standardization.

 



Fig. Hierarchical Database model
  

 3.  Network Databases:


In late 1960s, the Database Task Group (DBTG) formalized this model. 
Network data model is the extension of hierarchical data model. 
The network model replaces the hierarchical tree with a graph thus allowing more general connections among nodes.
It supports many-to- many relationships i.e. it allows a record to have more than one parent.

 Advantages 
  • Conceptual Simplicity: just like hierarchical model it also simple and easy to implement.
  • Capability to handle more relationship types: the network model can handle one to one1:1 and many to many N: N relationship.
  • Ease to access data: the data access is easier than the hierarchical model. 
  • Data Integrity: Since it is based on the parent child relationship, there is always a link between the parent segment and the child segment under it. 
  • Data Independence: The network model is better than hierarchical model in case of data independence. 
  • Database standard: Network model have universal standards formulated by the DBTG.

Disadvantages
  • System Complexity: All the records have to maintain using pointers thus the database structure becomes more complex. 
  • Operational Anomalies: As discussed earlier in network model large number of pointers is required so insertion, deletion and updating more complex. 
  • Not user-friendly: The network model is not a design for user-friendly system and is a highly skilled-oriented system. 
  • Absence of structural Independence: There is lack of structural independence because when we change the structure then it becomes compulsory to change the application too.









Fig. Network Data model

What is Database Management System (DBMS) ?

  • A database management system (DBMS) is an application that store interrelated data's (i.e. database) as a file system.
  • Primary goal of DBMS is to provide a way to store and retrieve database information that is both convenient and efficient. 

  • But the main drawback of DBMS is that DBMS do not implement any security constraints with regards to data manipulation and it also doesnot support distributed database system.

  • Since, DBMS is for the small organization and for the small data. So, it support single user. Hence,  in large organization it is eliminated by Relational Database Management System(RDBMS). 
  • Some popular DBMS software are:
  1. dBASE 
  2. FoxBASE 
  3. Oracle
  4. MYSQL
  5. MS SQL

  • For better understanding of data, database and database management system(DBMS) let us take an example just to resemble the sense:
         In a college,  student = data, faulty= Database and college= DBMS.

4.What is Relational Database?

  • A relational database refers to a database that stores data in a structured format, using rows and columns. This makes it easy to locate and access specific values within the database. 

  • It is "relational" because the values within each table are related to each other. One Table may also be related to other table.

  •  With a relational database, you can quickly compare information because of the arrangement of data in columns and since there is the use of keys chances of data redundancy is very less and searching of a particular data is also less in this.

  • Relational databases are created using a special computer language, structured query language (SQL).

STUDENT
S. No.
Name
Class
Faculty
1
Niru  karki
11
Science
2
Dipa Sharma
12
Management
3
Priyanka Joshi
11
Management

Fig. Relational Database of a XYZ College.

What is Relational Database Management System(RDBMS)?


  • An RDBMS is an application(software) designed specially for relational databases.



  • Example: Oracle, SQL server, MySQL, SQL Lite etc.

  • Most well known DBMS applications fall into the RDBMS category. Both DB and Relational DB can be run in these applications. Examples include Oracle Database, MySQL, Microsoft SQL Server, and IBM DB2. Some of these programs support non-relational databases, but they are primarily used for relational database management.

  • Examples of non-relational databases include Apache HBase, IBM Domino, and Oracle NoSQL Database. These type of databases are managed by other DMBS programs that support NoSQL, which do not fall into the RDBMS category.



Differences between DBMS and RDBMS






S. No
DBMS
RDBMS
1
It's full form is Database Management System.
It's full form is Relational Database Management System.
2
The concept of relationship is not found in this.
It is based on the concept of relationship.
3
It is used in small organization where data is less generated.
It is both useful in small and large organizations.
4
Hardware and software requirement is very less.
Hardware and software requirement is very high.
5
Uses the concept of file.
Uses the concept of relation(i.e. table)
6
Speed of operation is very slow.
Speed of operation is very fast.
7
Normalization is not present.
Normalization is present.
8
DBMS does not support the distributed database.
It support distributed database.
9
It support single user.
It support multiple users.
10
It does not support any security during data manipulations.
It has many security constraints.
11
Difficult to modify data.
Easy to modify data.
12
High Redundancy may occur as it does not enforce the use of keys and indexes.
Low chance of data redundancy is there as it enforce the use of keys and indexes.
13
e.g. XML, d BASE , FOXBASE etc.
e.g. SQL SERVER, ORACLE, MySQL  server etc.
14
Query is written using simple language like:
Q. Select names of all    employees.
= Select emp -name from          employee.
Query is written using operator like:
Q. Select names of all employees.
=Ï€ emp-name(employee).







5. Object Oriented Database:
  • An object-oriented database (OODBMS) or object database management system (ODBMS) is a database that is based on object-oriented programming (OOP).
  • In OOP, an entity is represented as an object and objects are stored in memory. OOP has key characteristics which are encapsulation, inheritance, and polymorphism. Today, there are many popular OOP languages such as C++, Java, C#, Ruby, Python, JavaScript, and Perl.

  • Object databases are commonly used in applications that require high performance, calculations, and faster results. Some of the common applications that use object databases are real-time systems, architectural & engineering for 3D modeling, telecommunications, and scientific products, molecular science, and astronomy.

  • Common examples OOP languages used are Smalltalk language is used in Gemstone  database, LISP is used in G-Base database, and COP is used in V-Base database.

Advantages:

  • Reduced maintenance: The primary goal of object-oriented development is the assurance that the system will enjoy a longer life while having far smaller maintenance costs. Because most of the processes within the system are encapsulated, the behaviors may be reused and incorporated into new behaviors. 
 
  • Real-world modelling: Object-oriented systems tend to model the real world in a more complete fashion than do traditional methods. Objects are organized into classes of objects, and, objects are associated with behaviors. The model is based on objects rather than on data and processing. 

  • Improved reliability: Object-oriented systems promise to be far more reliable than traditional systems, primarily because new behaviors can be built from existing objects. 

  • High code reusability: When a new object is created, it will automatically inherit the data attributes and characteristics of the class from which it was born or generated


Drawback:
  • Lack of good market: Object oriented databases are not as popular as RDBMS. It is difficult to find object DB developers. 

  • Lack of support: Not many programming language support object databases.
  • Lack of Standards: RDBMS have SQL as a standard query language. Object databases do not have a standard. 

  • Lack of Knowledge: Object databases are difficult to learn for non-programmers.

Database Integrity or Integrity constraints:
  • Integrity constraints are the set of rules.
  • It is the important feature in relational data model.
  • It is used to maintain the quality of information.
  • Integrity constraints ensures that the data insertion, updating and other process have to be performed in such a way that the data integrity is not affected.
  • Thus, integrity constraints is used to guard the accidental damage to the database.
  • It includes whether the data in database is correct, consistent and complete or not, if not then it violets the data integrity.


Types of data integrity:


                                      Fig. Types of Integrity Constraints

1. Domain Constraints: 
  • It say that the datatype of attribute and the data(tuples or record) must be matched.
Example:

STUDENT
S. No.
Name
Class
Faculty
1
Nisha Shrestha
11
Science
2
Deep Sharma
12
Management
3
Priyanka Joshi
E
Management


 In this table, Class must contain numeric value but one record or tuple doesn't contain numeric value i.e. E  so, this violets domain constraints.



2. Entity Integrity Constraint: 

  • This integrity ensures that the primary key which must not be NULL.
Example:



EMPLOYEE TABLE:

Primary key
     ↓
EMP_ID
Emp -Name 
Salary
Post
1
Nitu  karki
110000
marketing
2
Dipa Sharma
12000
accountant
-
Priyanka Joshi
200000
manager
   Not allowed

In this Employee table, EMP_ID is primary key and contain null value. So, this does not satisfies entity integrity constraint rule.


3. Referential Integrity Constraint:

It is also called primary key- foreign key concept.
For this rule, it need minimum two table(relation).
In this, if a foreign key in the table 1 refers to the primary key of table 2, then every value of the foreign key must be available in table 2 and if not then every value in table 1 must be null.

Example:

TABLE-1  :                                      

Foreign
Key
D_ No.
Name
Age
Emp_id(primary key)
11
Ninu  karki
11
1
24
Dipa Sharma
12
2
18
Priyanka Joshi
11
3


TABLE-2 :

Primary key    
    ↓
D_ No.
D_ Location
11
Kathmandu
24
Dhangadhi
13
Tikapur


Since all the element of  D_ No. (Primary key) in table-2 is not same as all the element of  D_No.(Foreign key) of table-1. Hence, above example violet the referential integrity rule. 


4. Key Constraints:
  • According to this rule, primary key must contain a unique value i.e. must not contain same value.
Example:

Primary key
   ↓
D_ No.
D_ Location
13
Kathmandu
24
Dhangadhi
13
Tikapur

Since, D_ No . is a primary key and there is repeated value 13 in two rows. So, this violet the key constraints rule.

1 Comments

Post a Comment

Previous Post Next Post