You are on page 1of 17

Chapter 2

Data Base Management System


Data
Data is the plural form of datum. Data can be defined as a set of isolated and unrelated raw facts,
represented by values which have little meaning. Data are raw facts. The word 'raw' is used to indicate that the
facts have not yet been processed to reveal their meaning.
Data has some key points to understand. These key points of data are:
 Data constitute the building blocks of information.
 Information is produced by processing data.
 Information is used to reveal the meaning of data.
 Good relevant and timely information are the key to good decision making.
 Good decision making is the key to organizational survival in a global environment.

Information
Data are information to the computer that is to be processed to get a relevant result. Processed results are
called information. Information can be defined as a set of organized and validated collection of data.
Thus, the term data processing means the process of collecting all items of data together to produce
meaningful information. It can be done either manually or by the use of computers. If data processing is done
with the help of computers, it is known as EDP (Electronic Data Processing).
Hence, the information that we obtain after processing the data must possess the following
characteristics.
 It must be accurate.
 It must be available in time as required.
 It must be complete so that more inference (conclusion) can be drawn.
 It should be precise in meaning.
 It should be relevant to the context.

Database
A database is a collection of logically related data files organized to facilitate access by one or more
applications programs and to minimized data redundancy. Database refers to a collection of records or files that
are stored in a logically related format, making them easy to associate and retrieve. Therefore, a database is a
collection of information that is organized so that it can easily be accessed, managed and updated. The example
of database are telephone directory, a library’s card catalog etc. A database consists of four major elements.
They are data elements or data items, relationships, constraints (rules) and schema (Description of data in term
of data model).

Functions of Database
In a general file processing system, records are stored permanently in various files. There are numerous
application programs which can extract records and add the records to the appropriate files. These processes
have many advantages and disadvantages. They cannot provide data redundancy (duplication of data) and
other facilities.

The functions of database are:


 To store, manipulate and manage the information.
 To reduce the repeated storage of the data (data redundancy) and improve the disk optimization.
 To keep latest and correct information (Data Consistency).
 To automate the data managing and processing system.
 To provide data validation facilities.
 To improve data security system.
Fundamentals of Database
Let us take the example of the following table of some students. This reflects the database concept that based
on data processing systems.
Roll No. Name English Nepali Science Math S. Std. Total
1. Susmita 78 56 78 90 90 392
2. Kamal 67 78 90 91 89 415
3. Amrit 56 45 55 78 80 314
4. Aakash 67 78 85 90 90 410
5. Shasank 78 56 80 90 70 374
The above table contains cells. Each cell comprises of the outer border. The border thus formed has made a grid
of cells. The combination of these cells is called Table.

Table: A table is a collection of related data held in a table format within a database. It consists of columns and
rows. The database in Relational Database Management System (RDBMS) like MS-Access is in table form. There
are many tables that you can create in a database. Each table has at least a primary key (Unique identification
of records).

Field: A field is a piece of information about an element. A field is represented by a column. Every field has got
a title called the field title.

Record: A record is an information about an element such as a person, student, an employee, client, etc. A
record can have much information in different heading or titles. Rows are also called records or tuples and they
corresponds to entities.

Tuple: Tuple is the collection of information about the attributes of table for single instance. This also can be
called as a 'row' in a Table. In simple Row wise collection of data is known tuple.

Basic Terms of Database


Some important database-related terms are as follows:
Data Type: A data type determines the type of data that can be stored in a column (field). The most common
data types used in databases are Alphanumeric, Boolean and Data and time.
Key: A key or key field is a column value in the table that is used to either uniquely identify a row of data in a
table or establish a relationship with another table. The keys can be of three types. They are Primary key, Foreign
key and Candidate key.
Data Dictionary: The data dictionary defines the basic organization of a database. It contains the list of all files
in the database, the number of records in each file and the names and types of each field.

Database Management System (DBMS)


A database is managed by software. A program or group of programs used to manage a database is
called database management system. That means software or group of programs that defines a database, stores
the data, supports query language, produces reports and creates data entry screens.
The set of programs that provides facilitate the user in organizing, creating, deleting and manipulating
their data in a database is also known as DBMS. The example of DBMS are MS-Access, Oracle, MYSQL, SQL
Server etc.
Benefits of Database Management System
Reduction in data redundancy: In non-database systems, each application has its own separate files. Each file
can have repeated data in different ways which consume more space. The database management system
removes this problem
Reduction in data inconsistency: The contradictory of a presence of same data in various forms in the different
database can be removed.
Sharing of data is possible: Same database or table can be shared with more than one end user during data
processing.
Enforcement of standards: In database management systems, new standards have emerged which can be
applied.
Improved in data security: DBMS provides check and validation rules for the users while accessing databases.
This prevents from piracy of database and data manipulation.
Maintenance of Data Integrity: The data integrity refers to the accuracy of data. The database management
system provides correct and relevant data records.
Better interaction with end users: The screens and interfaces for the users have become more friendly in
database management systems.
Efficient systems: The overall efficiency of the database management system is increased tremendously due to
the use of new versions of database management systems.

Features of Traditional Database System


The most common database management systems used in early time were DB2, DBASEIII, DBASEIII+,
FOXPRO, etc. The applications were developed independently for different departments and organizations and
files of information relevant to one particular department were created and processed by dozens or even
hundreds of separate programs.
The features of traditional database management system are:
Data redundancy: The data of a single record was present in a different place in different form and it was
repeated in many ways.
Data inconsistency: When data in a file is changed it did not support other database or files.
Program –Data Dependence: The data were merely dependent on the program. Any change in the structure of
database led to damage of data.
Data was not shareable: Data in different computers were personalized. They were not accessible from other
computers and users.
Data integrity: The database integrity was not maintained.

Relational database Management System (RDBMS)


A DBMS that is based on relational model is called as RDBMS.
 Relational model represents data in the form of a table. A table is a two-dimensional array containing
rows and columns. Each row contains data related to an entity such as student. Each column contains
the data related to a single attribute of the entity such as student name.
 One of the reasons behind the success of relational model id its simplicity. It is easy to understand the
data and easy to manipulate.

Features of RDBMS
 All data stored in the tables are provided by an RDBMS.
 Ensures that all data stored are in the form of rows and columns.
 Facilitates primary key, which helps in unique identification of the rows.
 Index creation for retrieving data at a higher speed.
 Facilitates a common column to be shared amid two or more tables.
 Multi-user accessibility is facilitated to be controlled by individual users.
 A virtual table creation is enabled to store sensitive data and simplify queries.
Advantages / Functions of RDBMS
 Data security-data is immune to program crashes.
 Concurrent Access-atomic updates via transactions.
 Fault tolerance-replicated dbs for instant failover on machine/disk crashes
 Data integrity- to keep data meaningful (correctness and consistency)
 Scalability- can handle small/large quantities of data in a uniform manner.
 Reporting- Easy to write SQL programs to generate arbitrary (random choice) reports.

Disadvantages of RDBMS
Cost: The expense of maintaining and even setting up a database system is relatively high and one of the
drawbacks of relational databases. A special software is required for setting up a relational database and this
could cost a fortune.
Managing Huge Volumes of Data: The complication in information is another shortcoming of relational
databases. The data arranged within relational databases are based on common characteristics. Systems such
as multimedia products, complicated images, numbers, and designs have a structure that can accommodate
applications that are complex and are easily scalable.
Structured Limits: Relational databases impose limits on field lengths. While designing the database, it is
necessary that you specify the data volume you intend to introduce within any field. Since some of the search
queries are or might be precise than the original ones, this might lead to loss of data.
Abundance of Information: Advances in the complexity of information cause another drawback to relational
databases. Relational databases are made for organizing data by common characteristics. Complex images,
numbers, designs and multimedia products defy (refuse to obey) easy categorization leading the way for a new
type of database called object-relational database management systems. These systems are designed to handle
the more complex applications and have the ability to be scalable.

Difference between DBMS and RDBMS


DBMS RDBMS
DBMS relationship between two tables or files is RDBMS relationship between two tables or files
maintained programmatically. can be specified at the time of table creation.
DBMS does not support Client/Server Most of the RDBMS supports Client/Server
Architecture. Architecture.

DBMS does not support Distributed databases. Most of the RDBMS supports Distributed
databases.
DBMS does not follow normalization, only single RDBMS follows normalization, multiple users can
user can access the data. access the data simultaneously.
DBMS there is no security of data. RDBMS there are multiple levels of security

Each table is given an extension in DBMS. Many tables are grouped in one database in
RDBMS.
Examples of DBMS are file systems, XML etc. Example of RDBMS is MySQL, SQL Server, Oracle,
MS-Access etc.

Flat file Database System


A flat-file database is a database stored in a file called a flat file. Records follow a uniform format, and
there are no structures for indexing or recognizing relationships between records. The file is simple. A flat file
can be a plain text file.
The concept of relationship is missing in a DBMS, is called Flat File Database System.
Advantages
 Platform used is normally DOS
 It is simple.
 It is portable.
 Uses concept of file.
 It stores data in a single table structure.
 It can be read directly by a verity of software.
Disadvantages
 Speed of operation is slow.
 Facilities offered are limited.
 Flat file systems insecure.
 It is plain text file that stores one record per line.
 It does not use index.

Database Model / Data model


A data model in software engineering is an abstract model that describes how data is represented and
accessed.
Data models formally defines data elements and relationships among data elements for a domain (Set
of permitted value for particular attribute) of interest. Data model explicitly determines the meaning of data,
which is also known as structured data. The data model can be described using three parts.
 Data structure
 Data manipulation
 Data constraints
Data structure: It describes the data type, content, an association between data and so on. Data structure is
the basis of data model and data manipulation and constraints are built on the data structure. Different data
structures have different data manipulation and constraints.
Data Manipulation: It describes the operation type and ways of operation on the data structure.
Data constraints: It describes the data syntax, association of semantic between the data in data structure, and
the interdependence and constraint between data, the rule of data with dynamic change, which in order to
make the data correct, effective and compatible.

Types of database models


There are different types of database management system, each are characterized by the way in which
data are defined and structured of database. The database model defines the manner in which the various files
of database are linked together. There are mainly four types of database model commonly in used. They are:
i. Hierarchical Database Model
ii. Network Database Model
iii. Relational Database Model and
iv. Object Oriented Database Model

Hierarchical Database Model


A hierarchical database model is a data model in which the data are organized into a tree-like structure.
The data are stored as records which are connected to one another through links. A record is a collection of
fields, with each field containing only one value. The type of a record defines which fields the record contains.
The hierarchical database model mandates that each child record has only one parent, whereas each
parent record can have one or more child records. In order to retrieve (access) data from a hierarchical database
the whole tree needs to be traversed starting from the root node. This model is recognized as the first database
model created by IBM in the 1960s.
The hierarchical structure was developed by IBM in the 1960s, and used in early mainframe DBMS.
Records' relationships form a treelike model. This structure is simple but inflexible because the relationship is
confined to a one-to-many relationship.
Organization

Personal Dept Financial Dept Technical Dept

Staff Manage Staff Manager Staff Manager


r
Fig: Hierarchical Database Model

Advantages:
 Searching is fast and easy, if parent is known.
 It is easiest model than other database model.
 The relationship between various layers is logically simple.
 This system provides a tough database security.
 Hierarchical database system maintains data independence i.e. if a data is altered in one table, it does
not affect the other location.
 There is always a parent-child relationship and data integrity is maintained.
 Very efficient in handling ‘one to many’ relationship.
Disadvantages:
 It is old model of database.
 Difficult to modification and addition of child.
 It increases redundancy.
 The physical implementation of the database is complicated.
 It cannot handle ‘many-to-many’ relationship.

ii) Network Database Model


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

College

English Physics Account Maths Computer

Ram Shyam Sita Hari

Fig: Network Database Mode


Advantages:
 The database is conceptually simple in structure.
 It has more flexibility.
 It reduces data redundancy.
 Searching is fast because of multi directional pointer.
 It accepts many-to-many relationship.
Disadvantages:
 Difficult to sort data.
 Very complex type of database model.
 Need long programs for relationship.
 Lack of structural independence.

iii) Relational Database Model


The Relational Model, first developed by E.F. Codd (of IBM) in 1970, represented a major breakthrough
for both users and designers.
A database model in which the data elements are organized in the form of multiple tables and the data
in one table is related to the data in another table through the use of a common field.
The relational model represents the database as a collection of relations. A relation is nothing but a table
of values. Every row in the table represents a collection of related data values. These rows in the table denote
a real-world entity or relationship.
The table name and column names are helpful to interpret the meaning of values in each row. The data
are represented as a set of relations. In the relational model, data are stored as tables. However, the physical
storage of the data is independent of the way the data are logically organized.
Table 1 Table 2

Std_id Sub_id
name Sub1
class Sub2
Section Std_id
Fig: Relational Database Model

Advantages:
 Rapid database process.
 Easy for searching of data.
 Referential integrity can be applied.
 It provides excellent data security.
 This model is simpler and possesses improved conceptual simplicity.
 It provides easier database design, implementation, management and use.
 It possesses a powerful database management system.
Disadvantages:
 It is complex to maintain than other database model.
 We have to apply many rules.
 It is not user friendly.

iv) Object oriented database model


The object-oriented database model was introduced to overcome the disadvantages of other database
model. This database model is logical organization of the real-world objects (entities), constraints (rules) on
them and relation among them. A database model that captures object-oriented concept such as class
hierarchy, inheritance and method is an object-oriented database model. An object-oriented database model
is collection of objects whose behaviour (method) and the relationship.

Components of OODM:
Object: An object is the abstraction of the real-world entity and an object represents only one occurrence of
entity.
Attributes: It describes the property of an object. Such as person is an object whereas name, age, DOB are
properties or attributes.
Class: Objects that are similar in characteristics or collection of similar objects with shared (common) attributes
and behaviour (method) is called class.
Method: Method represents a real-world action, such as finding a selected person’s name, changing person’s
name or printing a person’s address.

Entity Relationship Database Model


ER Diagram is graphical representation of different entities and their relationship. It is a tool for
relational database management. It is also known as an entity relationship model, is a graphical representation
of an information system that makes relationship among people, objects, places, concepts or events with that
system. An ERD is data modelling technique that can help define business processes and be used as the
foundation for a relational database.
ER Diagram provides a visual starting point for database design that can also be used to help determine
information system requirements throughout an organization.
Symbols Comments
It is used for entity relationship. It contains objects used in relational database.

Diamond represents relationship.

The oval is used to represents attributes of entities.

It is used to link attributes to entity sets and entity set to relationship.

The students appear in examination. The registration number, name, subjects etc are attributes of
student and subjects, schedules etc are attributes of examination. The registration number is used as key
attributes.

Registratio Schedule Physics


Name

Students Appear Examination Maths

Name Chemistry
Address Biology

Fig: Entity Relationship Diagram


Advantages
It yields a particularly easily viewed and understood conceptual view of a database’s main entities and their
relationships.
 The ERM gives the designers visual representation very clearly.
 The ERM has become one of significant effective communication tools in RDBMS.
 The ERM is well integrated with the relational database model.
Disadvantages
 Limited constraint representation due to limited model.
 The relationship between attributes within entities cannot be represented. Example, there is no way of
completed hours and classification of a student.
 It lacks in data manipulation language or commands.
 The models become crowded due to more presence of entities.

Concept of Normalization
The normalization is the process of organizing data in database to reduce the redundancies, it also includes
creating of tables and establishing the relationship between those tables using rules designed to protect the
data and to make database flexibility.
The essence of normalization is to split your data into several tales that will be connected to each other
based on the data within them.
Student info Personal info Subject table Marks table
Studentid Personalid Studentid Subject
Firstname Firstname Subject Marks
Lastname Lastname Roll
Class Class
Subject
Marks Normalized table
Roll
Unnormalized table
Fig: Normalization of data
In the above figure the first table is not in normalized form. Those we want to enter the marks we have
to enter all the information so there is chance of redundancy of data and it seem to be ineffective so the table
is split into other three tables to make data independent and the table is only depending by keys. The above
normalization helps us to make sure of:
 Dependence between the data is identified.
 Redundancy in database is minimized.
 The data model is making more flexible and easier to maintain.

Types of Normalization
1. First normal form (1NF)
When the table has no repeating group of data then it is said to be in first normal form. That means for each
cell in a table, there can be only one value. This value should be atomic in the sense that it can’t be decomposed
into smaller pieces.
Name Roll Class Sec Sub1 Marks1 Sub2 Marks2 Sub3 Marks3
Ram 2 12 A English 78 Comp 90 Maths 78
Shyam 1 11 B English 90 Comp 89 Maths 67
Hari 1 12 A English 67 Comp 98 Maths 90
The above table is not in normal form the attributes are most in repeated form to do in first normal form
we break table in the following way.
Name Roll Class Sec Subjects Marks
Ram 2 12 A Maths 90
Shyam 1 11 B English 90
Hari 1 12 A Computer 90
Ram 2 11 A English 78
Shyam 1 12 B Computer 67
Hari 1 11 A Maths 98
Ram 2 12 A Computer 78
Shyam 1 11 B Maths 89
Hari 1 12 A English 67

2. Second normal form (2NF)


The table is in second normal form if every non-key column depends on the entire key. For these split the
table. Pull out the columns that depend on parts of key. Remember to include that part of key in new table. The
new table must have key or id that must be on both tables. Each attribute in the table must depend on whole
key.
Table2: Subject Table3: Marks
Table1: Student Subject Class Name Subject Marks
Name Roll Class Sec English 11 Ram Maths 90
Shyam English 90
Ram 2 12 A English 12
Hari Computer 90
Shyam 1 11 B Computer 11 Ram English 78
Hari 1 12 A Computer 12 Shyam Computer 67
Maths 11 Hari Maths 98
Maths 12 Ram Computer 78
Shyam Maths 89
Hari English 67

In the above whole table is split into the three tables marks, subject and student. The interrelated data are
place together in the table. Name depends on roll+class+sec, subject name dependent on class not on roll.
Name, subject and marks are interrelated.

3. Third normal form (3NF)


The logical, analysis and elements of designing for third normal form are similar to those used in deriving 2NF.
In particular, you still concentrate on the issue of dependence. To be in 3NF a table must be in 2NF, and every
non-key column must depend on nothing but the key.
Table4: Marks
Table1: Class Table2: Subject
Stdid Subid Marks
Classid Classname Subid Subject
1 11 1 1 78
1 English
2 12 2 1 90
2 Computer
3 Maths 3 1 67
1 2 78
Table3: Student 2 2 67
Stdid Name Roll Classid Sec 3 2 90
1 Ram 2 2 A 1 3 90
2 Shyam 1 1 B 2 3 89
3 Hari 1 2 A 3 3 98
In the given table all the attributes are depends on the key thus in the table class subject and student all
the attributes depend on primary key but in table marks the data are dependent on stdid and subid. So, these
four tables are the normalized data of the given non-normalized tables.

Database Language
1. Data Manipulation Language (DML)
A data manipulation language (DML) is a family of computer languages including commands permitting
users to manipulate data in a database. This manipulation involves inserting data into database tables,
retrieving existing data, deleting data from existing tables and modifying existing data. DML is mostly
incorporated in SQL databases.
DML resembles simple English language and enhances efficient user interaction with the system. The
functional capability of DML is organized in manipulation commands like SELECT, UPDATE, INSERT INTO and
DELETE FROM, as described below:

SELECT: This command is used to retrieve rows from a table.


UPDATE: This command modifies data of one or more records.
INSERT: This command adds one or more records to a database table.
DELETE: This command removes one or more records from a table according to specified conditions.

2. Data Definition Language (DDL)


A data definition language (DDL) is a computer language used to create and modify the structure of database
objects in a database. These database objects include views, schemas, tables, indexes, etc.
This term is also known as data description language in some contexts, as it describes the fields and
records in a database table.
The present database industry incorporates DDL into any formal language describing data. However, it
is considered to be a subset of SQL (Structured Query Language). SQL often uses imperative verbs with normal
English such as sentences to implement database modifications. Hence, DDL does not show up as a different
language in an SQL database, but does define changes in the database schema.
Examples of DDL commands:
 CREATE – is used to create the database or its objects (like table, index, function, views, store
procedure and triggers).
 DROP – is used to delete objects from the database.
 ALTER-is used to alter the structure of the database.
 TRUNCATE–is used to remove all records from a table, including all spaces allocated for the records are
removed.
 COMMENT –is used to add comments to the data dictionary.
 RENAME –is used to rename an object existing in the database.

3. Data Control Language (DCL)


The Data Control Language (DCL) is a subset of the Structured Query Language(SQL) and allows database
administrators to configure security access to relational databases. It complements the Data Definition
Language (DDL), which is used to add and delete database objects, and the Data Manipulation Language
(DML) used to retrieve, insert, and modify the contents of a database.
DCL is the simplest of the SQL subsets, as it consists of only three commands: GRANT, REVOKE, and DENY.
Combined, these three commands provide administrators with the flexibility to set and remove database
permissions in an extremely granular fashion.
Examples of DCL commands:
 GRANT-gives user’s access privileges to database.
 REVOKE-withdraw user’s access privileges given by using the GRANT command.
4. Structure Query language (SQL)
Structure Query language (SQL) is a computer programming language used to manipulate information in
relational database management system (RDBMS). This enables several users on a local-area network to
access the same database simultaneously.
SQL is both the American National Standards Institute (ANSI) and International organization for
Standardization (ISO) standard for accessing data in RDBMS.
In practices, the DDL and DML are two separate languages. Instead the simply forms parts of a single
database language such as SQL. SQL represents combination of DDL and DML, as well as statements for
constraints specification and schema evaluation.
Examples of SQL commands:
SELECT: This command is used to retrieve rows from a table.
UPDATE: This command modifies data of one or more records.
INSERT: This command adds one or more records to a database table.
DELETE: This command removes one or more records from a table according to specified conditions.

Database System Environment


The term database system refers to the components of an organization that defines and regulate the
collection, storage, management and use of data within a database environment. From a general management
point of view, the database system is composed of the five major parts:

Fig: Database System Environment


Hardware: The computer
Software: The operating system, the utilities, the files, file management programs and application programs
that generate reports from the data stored in the files
People: Data processing managers, Data processing specialists, programmers and end users
Procedures: The instructions and rules that govern the design and use of the software component
Data: The collection of facts

Types of Database Systems


A database system gives us a way of gathering together specific pieces of relevant information. It also
provides a way to store and maintain that information in a central place. A database system consists of two
parts:
 The Database Management System (DBMS) which is the program that organizes and maintains these
lists of information, and
 The Database Application, a program that lets us retrieve, view, and update the information stored by
the DBMS.
1. Centralized Database
When all the data is stored in a central data store house then it is called centralized database. Every user
at different location accesses and uses the same central server to enter, edit, retrieve or modify the data. All
users use sane DBMS and same type of data structure. The centralized control and security measure can be
enforced. So, it has better local security.

Client Client Client Client

Database
SERVER

Fig: Centralized Database Processing System


Advantages:
 Centralized control over data.
 Lower processing overhead.
 Lower hardware, software cost and fewer complexes.
 Better data security.
 All data is stored, retrieved or modified from central server.
 Lower data integrity exposure.
Disadvantages:
 Comparatively poor reliability and availability.
 Higher communication cost.
 Slower response for certain queries.
 Poor data and failure recovery.
 Poor communication security.

2. Distributed Processing Systems


when the database is stored at more than one place, on more than one computer the it is called distributed
database. Different users can use different DBMS, different data structures and each site control its own data,
security and recovery mechanism. It also provides location transparency.

INTERNET

Client Client

Client SERVE Databas SERVE Client


e
Client Client

Fig. distributed processing system


Advantages:
 Fast data sharing.
 Better business unit and distribution.
 Reduce data communication cost and increased reliability.
 Better database recovery.
 Faster transaction and analysis processing.
Disadvantages:
 Higher processing overhead.
 Poor data security.
 High cost.

Difference between Centralized and Distributed database system


Centralized Database System Distributed Database System

Data resides in a single location. Data resides in several locations.

Centralized control over data. Local control over data.

Comparatively poor reliability and availability. Increased reliability and availability.

Higher communication cost. Lowe communication cost.

Slower response for certain queries. Faster response for certain queries.

Poor communication security. Better communication security.

Better data security. Poor data security.

It doesn’t contain several sites. It contains several sites.

Lower hardware, software cost and fewer Higher hardware and software cost, and more
complexes. complex.
Poor data and failure recovery. Better data and failure recovery.

Data Integrity
Database integrity means the correctness and consistency of data.
Requirements of data Integrity (Integrity constraints)
 it is another form of database protection. So, it used for it.
 Security means that the data must be protected from unauthorized operations.
 Integrity is related to the quality of data. It always provides better quality of data.
 Integrity is maintained with the help of integrity constraints:
i) Domain integrity
ii) Entity integrity
iii) Referential integrity
These constraints are the rules that are designed to keep data consistent and correct. They act like a check
on the incoming data.
 It is very important that a database maintains the quality of the data stored in it. DBMS provides several
mechanisms to enforce integrity of the data.
 It provides non-violation mode of database.
 It provides validity of a data.
 It provides accuracy and consistency of data in database.
 It provides the logical method to design database.
 It is basic element of database to give right information.

Types of Integrity:
There are mainly two types of data integrity. They are entity integrity, referential integrity and domain
integrity.
1. Entity Integrity
The entity integrity is a constraint on primary key value. It states that ant attribute of a primary key
cannot contain null value. If primary key contains null value, it is not possible to uniquely identify a record
in a relation. Entity integrity ensures that it should be easy to identify each entity in database. This integrity
rule can be applied to table columns to enforce different type of data integrity. Entity integrity includes the
following rules:
 Null Rule
 Unique Column Values
 Primary Keys value
2. Referential Integrity
The referential integrity is a constraint on foreign key value. It states that if a foreign key exists in a
relation, the foreign key value matches the primary key value of some tuple in its parent relation. Otherwise
the foreign key value must be completely null.
A referential integrity rule is rule defined on key (a column or set of columns) in one table that
guarantees that the values in the key match the values on a key in a related table (the referenced value).
Referential integrity is a database concept that ensures that relationships between tables remain
consistent.
3. Domain Integrity
Domain integrity also refers to the validity of data. Validity of data means types of data, range of data
and format of data etc on column. Data integrity can be compromised in a number of ways:
 Human errors when data is entered.
 Errors that occurs when data is transmitted from one computer to another.
 Software bugs or viruses.
There are many ways to minimize these threats of data integrity. These include:
 Backing up data regularly.
 Controlling access to data via security mechanisms.

Database Administration (DBA)


Database administration is a job whose primary function is the overall support of computer database.
These support tasks are performed by a person called a database administrator. Database requires constant
management and upkeep, and a DBA is specially trained to perform all of the functions necessary to do so. A
DBA is normally required to have degree in supporting a specific database system.

Knowledge/ Qualities/ Skills of Good DBA


 Excellent communication skills: He or she must be able to explain database concepts clearly to all
developers and programmers accessing the database.
 Formal Education: Many employers require, professionals to have a bachelor’s degree in computer
science or information systems.
 Real-world experience: A person should have knowledge about both theoretical as well as practical
knowledge. If the persons have certificates but no job experience is that they cannot get a job. This is
especially true in real job market.
 Knowledge of Database theory: The successful professional must have an understanding of database
and data warehouse design. This includes intimate knowledge of data normalization theory and
knowledge of data schema design as well as other database design methodologies.
The duties and responsibilities of DBA
 Overall design of the DBMS system.
 Installation, configuration and Maintenance of database and DBMS
 Monitor the performance of the system.
 Establish security policy evaluates DBMS features.
 Take care of the database design and implementation.
 Plan growth and changes.
 Setup and maintain documentation and standards.
 Works as part of a team and provide supports when required.

Data security
Data security is one of the challenging jobs of Database Administrators (DA). The secured data can be
transferred from one server to another server at great distances. For the prevention of data piracy and data
mining, proper securities are necessary to be implemented in the system. The two common methods of data
security are using the username and password. The username authentication and password verification can
allow for data access. So, data security is a preventive measure that a Database Administrator (DA) must take
for the protection of data from the unauthorized access, theft, corruption, etc.
To protect the database, we must take security measures at several levels:
 Physical: The sites or sites of containing the computer must physically secure against physical damage
from natural disaster and intruders. The physical security also consists of regular maintenance,
insurance, protect from theft etc.
 Human: Database user must be authorized carefully. The data piracy of user is also the factor that may
damage the database.
 Operating system: We can also make the database secure by the policy of operating system also today
there are many options of security provided by O.S.
 Network: We can also apply by the network physical layer, since all the database are connected through
the network.

System Security
In this process by which the various resources and information of a system against destruction and
unauthorized access.

Types of system security


1) External system security
2) Internal system security

External System Security


In this process by which computer system can be protected against external activities like flood, fires
etc.
It is maintained by:
 User security guards to allow to entry of authorized persons.
 Allowing access to sensitive information.
 Use backup copies of data.
Internal system security
 User authentication: It provides password and user name and use in using before the system.
 Access Control: By using system database system architecture.

Note:
Primary Key: A key that can be used to uniquely identify a row in a table is called a primary key. Any column
can be act as a key. Therefore, a primary key is an attribute or combination of attributes that uniquely
identify each instance of an entity. A primary key’s main features are:
 It must contain a unique value for each row of data.
 It cannot contain null values.

Foreign Key: When a primary key of a parent key exists in a child entity, then thee key is called a foreign key.
A foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table
or the same table. In simpler words, the foreign key is defined in a second table, but it refers to the primary
key or a unique key in the first table. For example, a table called Employees has a primary key called
employee_id. Another table called Employee details has a foreign key which references employee_id in order
to uniquely identify the relationship between the two tables.

Candidate Key: A relation in which there is more than one attribute combination processing the unique
identification is called candidate key.

You might also like