IT-802 CLASS-12
PART-B Unit - 1: Database Concepts
1.1 Introduction
The key to organizational success is effective decision making which requires timely,
relevant and accurate information. Hence information plays a critical role in today's
competitive environment. Database Management Software (DBMS) simplifies the
task of managing the data and extracting useful information out of it.
Data is a collection of raw facts which have not been processed to reveal useful
information. Information is produced by processing data as shown in Figure
Database
Databases are being used extensively in our day-to-day life. Be it business,
engineering, medicine, education, library, to name a few. For example, consider the
name, class, roll number, marks in every subject of every student in a school.
To record this information about every student in a school, the school might have
maintained a register, or stored it on a hard drive using a computer system and
software such as a spreadsheet or DBMS package.
Such collection of related data that has been recorded, organized and made
available for searching is called a Database.
A database has the following properties:
1) A database is a representation of some aspect of the real world also called
mini world. Whenever there are changes in this mini world, they are also
reflected in the database.
2) It is designed, built and populated with data for specific purpose.
3) It can be of any size and complexity.
4) It can be maintained manually, or it may be computerized.
Need for a Database
In traditional file processing, data is stored in the form of files. A number of
application programs are written by programmers to insert, delete, modify and
retrieve data from these files. New application programs will be added to the
system as the need arises.
Database Management System (DBMS) A database management system is a
collection of programs that enables users to create, maintain and use a database.
It enables creation of a repository of data that is defined once and then accessed
by different users as per their requirements.
The various operations that need to be performed on a database are as follows:
1. Defining the Database: It involves specifying the data type of data that will be stored
in the database and any constraints on that data.
2. Populating the Database: It involves storing the data on some storage medium that is
controlled by DBMS.
3. Manipulating the Database: It involves modifying the database, retrieving data or
querying the database, generating reports from the database etc.
4. Sharing the Database: Allow multiple users to access the database at the same time.
5. Protecting the Database: It enables protection of the database from software/
hardware failures and unauthorized access.
6. Maintaining the Database: It is easy to adapt to the changing requirements. Some
examples of DBMS are – MySQL, Oracle, DB2, IMS, IDS etc.
Characteristics of Database Management Systems
The main characteristics of a DBMS are as follows:
• Self-describing Nature of a Database System
• Insulation Between Programs and Data:
• Sharing of Data
Types of Users of DBMS
DBMS is used by many types of users depending on their requirements and interaction
with the DBMS. There are mainly four types of users:
1. End Users: Users who use the database for querying, modifying and generating reports
as per their needs. They are not concerned about the working and designing of the
database. They simply use the DBMS to get their task done.
2. Database Administrator (DBA): As the name implies, the DBA administers the
database and the DBMS. The DBA is responsible for authoring access, monitoring its use,
providing technical support, acquiring software and hardware resources.
3. Application Programmers: Application programmes write application programs to
interact with the database. These programs are written in high level languages and SQL
to interact with the database.
4. System Analyst: System analyst determines the requirements of the end users and
then develops specifications to meet these requirements. A system analyst plays a major
role in the database design and all the technical, economic and feasibility aspects.
Advantages of using DBMS Approach
The need of DBMS itself explains the advantages of using a DBMS. Following are the
advantages of using a DBMS:
1. Reduction in Redundancy: Data in a DBMS is more concise because of the central
repository of data. All the data is stored at one place. There is no repetition of the same
data. This also reduces the cost of storing data on hard disks or other memory devices.
2. Improved Consistency: The chances of data inconsistencies in a database are also
reduced as there is a single copy of data that is accessed or updated by all the users.
3. Improved Availability: Same information is made available to different users. This
helps sharing of information by various users of the database.
4. Improved Security: Though there is improvement in the availability of information to
users, it may also be required to restrict the access to confidential information.
5. User Friendly: Using a DBMS, it becomes very easy to access, modify and delete data.
It reduces the dependency of users on computer specialists to perform various data
related operations in a DBMS because of its user-friendly interface.
Relational Database
Relational database developed by E.F Codd at IBM in 1970. It is used to organize
collection of data as a collection of relations where each relation corresponds to a table
of values. Each row in the table corresponds to a unique instance of data and each
column name is used to interpret the meaning of that data in each row.
In relational model,
A row is called a Tuple.
A column is called an Attribute.
A table is called as a Relation.
The data type of values in each column is called the Domain.
The number of attributes in a relation is called the Degree of a relation.
The number of rows in a relation is called the Cardinality of a relation
Relation Schema R is denoted by R (A , A , A …, A ) where R is the relation name 1 1 and
A , A , A ,….A is the list of attributes. 2 3 n 2 3, n Relation State is the set of tuples in the
relation at a point in time.
A relation state r of relation schema R (A , A , ..., A ), denoted r(R) is a set of n-tuples r = {t
, 1 2 2 n 1 t ,...., t }, where each n-tuple is an ordered list of values t = <v , v , ...,v >, where
v m 1 2 i is in domain of A or is NULL. Here n is the degree of the relation and m is the
cardinality of n i the relation.
Relational Model Constraints
Constraints, are restrictions on the values, stored in a database based on the
requirements.
Domain Constraint: It specifies that the value of every attribute in each tuple must be
from the domain of that attribute.
For example, the Employee_ID must be a 4-digit number. Hence a value such as “12321”
or “A234” violates the domain constraint as the former is not 4-digit long and the latter
contains an alphabet.
2. Key Constraint: Before we can explain this constraint, we need to describe the terms
superkey, key, candidate key and primary key.
(i) Superkey is a set of attributes in a relation, for which no two tuples in a relation state
have the same combination of values. Every relation must have at least one superkey
which is the combination of all attributes in a relation.
Thus for the EMPLOYEE relation, following are some of the superkeys: (a) (b) (c) (d) (e)
{Name, Employee_ID, Gender, Salary, Date_of_birth} - default superkey consisting of all
attributes. {Name, Employee_ID, Date_of_Birth} {Employee_ID, Gender, Salary} {Name,
Employee_ID, Gender} {Employee_ID}