Subject : [BCS-403] Relational Database Management System
Class : SYBSc [CS] - Sem IV
Staff : Ms.Archana Oza
Unit I : Introduction and Basic Concepts
Important terms :
1. Data : The term data maybe defined as known facts or raw facts that could be
recorded or stored on computer system.
2. Information : Information may be defined as processed, organized or summarized
data. Data is processed to create information.
3. Database : A database is an organized collection of data. In other words, a database
is a collection of information in a systematic manner in the form of tables. A table is
a collection of rows and columns.
DBMS Definition :
DBMS stands for Database Management System. It is a
software or a set of programs that allows users to create, process, store, retrieve
and manage the Data.
It is also defined as a computerised record keeping system that
stores information and allows the users to add, delete, modify, retrieve and update
that information.
1|P ag e
Structure Of DBMS :
The overall structure of DBMS is graphically represented as
below. The major components of this structure are described in brief as :
(1.) Storage Manager :
I.) Data Manager
The data manager is the central software component of the
DBMS. It’s important function is to convert the user’s query from logical view to
physical file system.
This query comes directly via translators or indirectly via
applications. It also performs backup and recovery operations.
2|P ag e
II.) File Manager
The data manager is responsible for maintaining the structure
of files and the file space. It is also responsible for locating the block from disk manager
and transmitting the query to the data manager.
IIII.) Disk Manager
The disk manager performs all the physical input and output
operations. It transfers the block requested by the file manager. Only the disk manager
is connected with the physical database.
(2.) Physical Database :
Physical database includes the data files and the data
dictionary. Data files contain the original data of the database. Data dictionary contains
the metadata. Metadata is information related to the structure and uses of the data in
the database .
It contains the source of each data value, the frequency of its
use and related updates.
(3.) Query Processor :
Query Processor is used to read the queries from the users
and convert it into a well organised series of operations and send it to the data manager
for execution. It includes :
I.)DDL Interpreter
This tool is used to translate the DDL statements in a form that
can be understood by the system. It produces the schema for a table to define its
structure.
II.)DML Compiler
This tool is used to translate the DML statements in a form
that can be used by other components of DBMS.
3|P ag e
(4.) Naïve users :
Naïve users are the new users who interact with the system using any
software application. These users don’t have any knowledge about the presence of
database or its internal working.
For e.g: A user of an ATM machine.
The operations that can be performed by these users are very limited.
(5.) Casual users :
Casual users are the sophisticated users who interact with the database from
the terminal end. These users do not use any application software but interact with
the database using query language.
Casual users have a good knowledge of database and its queries.
For e.g: Users who submit queries using SQL.
(6.) Application Programmers :
These are professional programmers who are responsible for developing
application programs using programming languages. Programs could be written
in various languages as C, C++, Java, Pascal, etc.
These languages include special features to facilitate data storage and display
of data on the screen.
(7.) Database Administrator :
A DBA can be a single person or a group of persons who are responsible for
creating, modifying and managing data in the database.
The high-level administrator who has a centralized control
of the database is called DBA. He makes the policies, strategies and also provides
technical support to the database.
4|P ag e
Advantages of DBMS :
A database management system is defined as the software
system that allows users to create, maintain and control data.
Some of the advantages of DBMS are as described below :
1. Minimal Data Redundancy : Data redundancy refers to the duplication of data. As
DBA has a centralised control on data, it avoids unnecessary duplication using
various normalization techniques.
No data redundancy saves storage space and also
improves the access time.
2. Data Consistency and Integrity : Data redundancy also leads to data inconsistency.
DBMS maintains data consistency by ensuring that multiple copies of data have the
same updated values. Consistency of data provides data accuracy and correctness.
For e.g : A student have address column in two tables,
during any update if only one table value is changed then the data remains
inconsistent.
3. Data Sharing : In DBMS, data can be shared among authorized users of the
database. All the users have certain rights to access database. It assigns permissions
to users to access the database. Users are allowed to share data among them.
4. Data security : Data security means protecting important data from unauthorized
access. Data in database should be kept secured to avoid the loss of data. For this,
only authorized users are allowed to access the data.
DBMS uses various security mechanisms to keep the data safe and theft free.
5. Data Atomicity : Any complete transaction in database is called an atomic unit.
DBMS is responsible to store complete transaction in database. If any transaction is
partially completed then it rolls back them.
For e.g: During railway reservation if user completes the process of reservation then
money will be deducted from his account while if money is deducted without any
ticket booking then the money is credited back to the account.
6. Integrity constraints : Constraints are the rules that are used to store accurate data
as there are multiple users who feed data. For this, DBMS provides the capability to
apply rules on database.
For e.g : Maximum marks of a student can never be more
than 100, account balance of any user if reaches below 3000 then the user is
penalised.
5|P ag e
Disadvantages of DBMS :
Inspite of the various advantages, the database system also
has some features that are recognized as demerits for it. Those disadvantages are
described in brief as below:
1. Requirement of new and specialised manpower : Due to rapid changes in database
technology there is a need to hire, train or retrain its manpower on a regular basis.
It becomes difficult for administrator to manage the new staff who
must be trustworthy as the database passes crucial data.
2. Increased Installation and management cost : The large and complex DBMS
software has a high initial cost. It requires trained manpower to install and operate
the system.
Installing such a system also requires upgrade to the hardware,
software and data communication systems. Also, additional costly software may be
needed to provide security and to ensure the proper concurrent updating of shared
data.
3. Replacement cost : The cost of replacement from legacy system (old database) to
modern environment in terms of both money and time is very high.
In some situations, the cost of extra hardware and other tool may be
insignificant compared with the cost of software replacement.
4. Organizational Conflicts: A centralized and shared database needs to have proper
data definitions as well as responsibilities for accurate data maintenance.
As per past experiences, sometimes there may be conflicts on data
definition, formats, etc. Use of appropriate approaches is required to handle such
frequent issues. DBA must also acquire organisational commitment from employee
to avoid conflicts.
5. Need for Explicit backup and recovery : For a centralized shared database to be
accurate and available at all times, it must be kept secured from physical damages.
Thus, additional storage devices are used for maintaining backup and
recovery operations.
However, modern DBMS has now automated the process of backup.
6. Large size of DBMS : The complexity and functionality makes DBMS an extremely
large piece of software.
6|P ag e
It occupies many gigabytes of storage, Disk-space and requires a
great amount of main memory to run efficiently.
DBMS Users :
DBMS is utilized by a large variety of users to retrieve and
manipulate data. The users of database system can be classified depending in the
mode of their interaction with DBMS. Some of the DBMS users are described in
brief as below:
1. End Users: End Users are those users who access the database from the terminal
end. They use the developed applications. The two different end users are:
Naïve Users: Naïve users are the new users who interact with the system
using any software application. These users don’t have any knowledge about
the presence of database or its internal working.
For e.g: A user of an ATM machine.
The operations that can be performed by these users are very limited.
Casual Users: Casual users are the sophisticated users who interact with the
database from the terminal end. These users do not use any application
software but interact with the database using query language.
For e.g: Users who submit queries using SQL.
Casual users have a good knowledge of database and its queries.
2. Application Programmers: These are professional programmers who are
responsible for developing application programs using programming languages.
Programs could be written in various languages as C, C++, Java, Pascal, etc.
These languages include special features to facilitate
data storage and display of data on the screen.
3. Database Administrator: A DBA can be a single person or a group of persons who
are responsible for creating, modifying and managing data in the database.
The high-level administrator who has a centralized control
of the database is called DBA. He makes the policies, strategies and also provides
technical support to the database.
4. Specialized Users: The sophisticated users who write special programs are called
sophisticated users. They write complex programs for specific complex needs.
Basically, knowledge based and expert systems are managed by these users.
7|P ag e
5. System Analysts : A system analyst is responsible for managing the design, structure
and properties of database. The main goal is to manage economic and technical aspects
of DBMS. They use various available tools to acquire higher output with greater
efficiency.
Entity, Attributes and Domains :
Entity
An entity can be a real-world object, either animate or inanimate, that can
be easily identifiable. For example, in a school database, students, teachers,
classes, and courses offered can be considered as entities. All these entities have
some attributes or properties that give them their identity.
An entity set is a collection of similar types of entities. An entity set may
contain entities with attribute sharing similar values. For example, a Students set
may contain all the students of a school; likewise a Teachers set may contain all
the teachers of a school from all faculties.
Attributes :
Entities are represented by means of their properties, called attributes. All
attributes have values. For example, a student entity may have name, class, and
age as attributes.
Types of attributes
1. Simple attributes - Attributes that cannot be further subdivided are simple
attributes. These are unique values.
For e.g: Roll_no, Mobile_no, etc.
2. Composite attributes - Attributes that can be further subdivided are composite
attributes. These are made up of simple attributes.
For e.g : Student_name - first, middle, last.
3. Single-valued attributes - Attributes with only one value is single valued attribute.
For e.g : Roll_no, Name, etc.
4. Multi-valued attributes - Attributes with more than one value are multi-valued
attributes.
For e.g : Mobile_no, Email_id, etc.
8|P ag e
5. Derived attributes - Attributes that do not have physical existence in the database
but get their values from existing attributes are derived attributes.
For e.g : DOB derives age, average salary derived from salary.
Domains :
Domain refers to a set of permitted values. There exists a domain or range
of values that can be assigned to attributes. For example, a student's name
cannot be a numeric value. It has to be alphabetic. A student's age cannot be
negative, etc.
Tuples, Relations and their Schema :
Student
ROLL_NO NAME ADDRESS PHONE AGE
1 RAM DELHI 9455123451 18
2 RAMESH GURGAON 9652431543 18
3 SUJIT ROHTAK 9156253131 20
4 SURESH DELHI 7896541230 18
Tuples
Each row in the relation is known as tuple. A single row of a table,
which contains a single record for that relation is called a tuple.
The above relation contains 4 tuples, one of which is shown as :
1 RAM DELHI 9455123451 18
Relations
9|P ag e
A relation in a relational database is described as a table. Table is
organized into rows and columns.
E.g. : Student is a relation in the above example. It has 5 columns as :
Roll_no, Name, Address, Phone, Age
Relational Schema
A relation schema represents name of the relation with its attributes.
e.g.; STUDENT (ROLL_NO, NAME, ADDRESS, PHONE and AGE) is relational
schema for STUDENT.
10 | P a g e