You are on page 1of 15

Database is a collection of related data and data is a collection of facts

and figures that can be processed to produce information.

Mostly data represents recordable facts. Data aids in producing


information, which is based on facts. For example, if we have data about
marks obtained by all students, we can then conclude about toppers and
average marks.

A database management system stores data in such a way that it


becomes easier to retrieve, manipulate, and produce information.

DBMS stands for Database Management System. We can break it like this DBMS = Database + Management System.
Database is a collection of data and Management System is a set of programs to store and retrieve those data. Based
on this we can define DBMS like this: DBMS is a collection of inter-related data and set of programs to store & access
those data in an easy and effective manner.

What is the need of DBMS?


Database systems are basically developed for large amount of data. When dealing with huge amount of data, there
are two things that require optimization: Storage of data and retrieval of data.

Storage: According to the principles of database systems, the data is stored in such a way that it acquires lot less
space as the redundant data (duplicate data) has been removed before storage. Lets take a layman example to
understand this:
In a banking system, suppose a customer is having two accounts, one is saving account and another is salary account.
Lets say bank stores saving account data at one place (these places are called tables we will learn them later) and
salary account data at another place, in that case if the customer information such as customer name, address etc.
are stored at both places then this is just a wastage of storage (redundancy/ duplication of data), to organize the
data in a better way the information should be stored at one place and both the accounts should be linked to that
information somehow. The same thing we achieve in DBMS.

Fast Retrieval of data: Along with storing the data in an optimized and systematic manner, it is also important that
we retrieve the data quickly when needed. Database systems ensure that the data is retrieved as quickly as possible.

Database Applications DBMS


BY CHAITANYA SINGH | FILED UNDER: DBMS

Applications where we use Database Management Systems are:

Telecom: There is a database to keeps track of the information regarding calls made, network usage,
customer details etc. Without the database systems it is hard to maintain that huge amount of data that keeps
updating every millisecond.

Industry: Where it is a manufacturing unit, warehouse or distribution centre, each one needs a database to
keep the records of ins and outs. For example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from the distribution centre on each
day; this is where DBMS comes into picture.

Banking System: For storing customer info, tracking day to day credit and debit transactions, generating
bank statements etc. All this work has been done with the help of Database management systems.
Education sector: Database systems are frequently used in schools and colleges to store and retrieve the
data regarding student details, staff details, course details, exam details, payroll data, attendance details, fees
details etc. There is a hell lot amount of inter-related data that needs to be stored and retrieved in an efficient
manner.

Online shopping: You must be aware of the online shopping websites such as Amazon, Flipkart etc. These
sites store the product information, your addresses and preferences, credit details and provide you the relevant
list of products based on your query. All this involves a Database management system.

Advantages of DBMS over file system


BY CHAITANYA SINGH | FILED UNDER: DBMS

Drawbacks of File system:

Data Isolation: Because data are scattered in various files, and files may be in different formats, writing
new application programs to retrieve the appropriate data is difficult.

Duplication of data Redundant data

Dependency on application programs Changing files would lead to change in application programs.

Advantage of DBMS over file system


There are several advantages of Database management system over file system. Few of them are as follows:

No redundant data Redundancy removed by data normalization

Data Consistency and Integrity data normalization takes care of it too

Secure Each user has a different set of access

Privacy Limited access

Easy access to data

Easy recovery

Flexible

Disadvantages of DBMS:

DBMS implementation cost is high compared to the file system

Complexity: Database systems are complex to understand

Performance: Database systems are generic, making them suitable for various applications. However this
feature affect their performance for some applications

View of Data in DBMS


BY CHAITANYA SINGH | FILED UNDER: DBMS
Abstraction is one of the main features of database systems. Hiding irrelevant details from user and providing
abstract view of data to users, helps in easy and efficient user-database interaction.

To understand the view of data, you must have a basic knowledge of data abstraction and instance & schema. Refer
these two tutorials to learn them in detail.

1. Data abstraction

2. Instance and schema

Data Abstraction in DBMS


BY CHAITANYA SINGH | FILED UNDER: DBMS

Database systems are made-up of complex data structures. To ease the user interaction with database, the
developers hide internal irrelevant details from users. This process of hiding irrelevant details from user is called
data abstraction.

We have three levels of abstraction:


Physical level: This is the lowest level of data abstraction. It describes how data is actually stored in database. You
can get the complex data structure details at this level.

Logical level: This is the middle level of 3-level data abstraction architecture. It describes what data is stored in
database.
View level: Highest level of data abstraction. This level describes the user interaction with database system.

Example: Lets say we are storing customer information in a customer table. At physical level these records can be
described as blocks of storage (bytes, gigabytes, terabytes etc.) in memory. These details are often hidden from the
programmers.

At the logical level these records can be described as fields and attributes along with their data types, their
relationship among each other can be logically implemented. The programmers generally work at this level because
they are aware of such things about database systems.

At view level, user just interact with system with the help of GUI and enter the details at the screen, they are not
aware of how the data is stored and what data is stored; such details are hidden from them.

Overview of Database
A Database is a collection of related data organised in a way that data can be easily accessed,
managed and updated. Any piece of information can be a data, for example name of your
school. Database is actualy a place where related piece of information is stored and various
operations can be performed on it.

Database is a collection of related data and data is a collection of facts


and figures that can be processed to produce information.

Mostly data represents recordable facts. Data aids in producing


information, which is based on facts. For example, if we have data about
marks obtained by all students, we can then conclude about toppers and
average marks.

A database management system stores data in such a way that it


becomes easier to retrieve, manipulate, and produce information.

DBMS
A DBMS is a software that allows creation, definition and manipulation of database. Dbms is
actualy a tool used to perform any kind of operation on data in database. Dbms also provides
protection and security to database. It maintains data consistency in case of multiple users.
Here are some examples of popular dbms, MySql, Oracle, Sybase, Microsoft Access and
IBM DB2 etc.

Components of Database System


The database system can be divided into four components.
Users : Users may be of various type such as DB administrator, System developer and
End users.

Database application : Database application may be Personal, Departmental,


Enterprise and Internal

DBMS : Software that allow users to define, create and manages database access, Ex:
MySql, Oracle etc.

Database : Collection of logical data.

Functions of DBMS

Provides data Independence

Concurrency Control

Provides Recovery services

Provides Utility services

Provides a clear and logical view of the process that manipulates data.
Advantages of DBMS

Segregation of applicaion program.

Minimal data duplicacy.

Easy retrieval of data.

Reduced development time and maintainance need.

Disadvantages of DBMS

Complexity

Costly

Large in size

. Disadvantages of file system include:

Data redundancy and inconsistency

Difficulty in accessing data

Concurrent access anomalies

Security problem

Integrity problems

Data isolation

2. Advantages of DBMS over file system

i. Redundancy can be reduced:

A major difficulty was that many applications used their own special files of data. Thus, some data items were common
to several applications. For example address and phone number of particular customer may appear in a file that
consists of personal information and savings account also. This redundancy leads to higher storage and access costs.
Database systems can eliminate data redundancy, since all applications share a common pool of data. Essential
information such as customer name will appear just once in the database.

ii. Inconsistency can be avoided:

Since the same information can be present at multiple files in file systems, data needs to be updated at all the files
whenever any changes in data occur. For example, a changed customer address may be reflected in personal
information file, but not in savings account file. By having a centralized database, most of this can be avoided.
iii. Reduced programming effort:

A new application program often required an entirely new set of file definitions. Even though an existing file may contain
some of the data needed, the application often required a number of other data items. As a result, the programmer had
to recode the definitions of needed data items from the existing file as well as definitions of all new data items. Thus, in
file-oriented systems, there was a heavy interdependence between programs and data.

Database provides a separation between programs and data, so that programs can be somewhat independent of the
details of data definition. By providing access to a pool of shared data and by supporting powerful data manipulating
languages, database systems eliminate a large amount initial and maintenance programming.

iv. Security can be enforced:

Not every user should be able to access all the data. For example, in a banking system, payroll personnel need only the
information about various bank employees. They do not need access to customer accounts. Since, in the file systems,
application programs are added to systems in ad-hoc manner, it is difficult to enforce security constraints.

With central control over the database, the DBA (Database Administrator) can define the access paths for accessing the
data stored in the database and he can define authorization checks whenever access to sensitive data is attempted.

v. Integrity can be maintained:

The data values stored in the database must satisfy certain types of consistency constraints. For example, the balance
of a bank account may never fall below a particular amount. In file system, these constraints are enforced by adding
appropriate code in various application programs. However, when new constraints are added, it is difficult to change the
programs to enforce them.

Centralized control of the data helps in permitting the administrator to define integrity constraints to the data in the
database.

What are INTANCES, SCHEMAS AND SUBSCHEMA in DBMS?


BY DINESH THAKUR

Database changes over time when information is inserted or deleted. The collection
of information stored in the database at a particular moment is called an instance of
the database. The overall design of the database is called the database schema.

A schema diagram, as shown above, displays only names of record types (entities)
and names of data items (attributes) and does not show the relationships among the
various files.
The schema will remain the same while the values filled into it change from instant to instant. When the schema framework is filled in with data item
values, it is referred as an instance of the schema. The data in the database at a particular moment of time is called a database state or snapshot, which
is also called the current set of occurrences or instances in the database

In other words, "the description of a database is called the database schema, which is
specified during database design and is not expected to change frequently". A
displayed schema is called a schema diagram.

A schema diagram displays only some aspects of a schema, such as the namer. of
record types and data items, and some types of constraints. Other aspects are not
specified in the schema diagram. It does not specify the data type of each data item
and the relationships among the various files.

Subschema

A subschema is a subset of the schema and inherits the same property that a schema
has. The plan (or scheme) for a view is often called subschema. Subschema refers to
an application programmer's (user's) view of the data item types and record types,
which he or she uses. It gives the users a window through which he or she can view
only that part of the database, which is of interest to him. Therefore, different
application programs can have different view of data.

Database Schema
A database schema is the skeleton structure that represents the logical
view of the entire database. It defines how the data is organized and how
the relations among them are associated. It formulates all the constraints
that are to be applied on the data.

A database schema defines its entities and the relationship among them.
It contains a descriptive detail of the database, which can be depicted by
means of schema diagrams. Its the database designers who design the
schema to help programmers understand the database and make it
useful.

A database schema can be divided broadly into two categories


Physical Database Schema This schema pertains to the actual storage of data and its form of storage
like files, indices, etc. It defines how the data will be stored in a secondary storage.

Logical Database Schema This schema defines all the logical constraints that need to be applied on the
data stored. It defines tables, views, and integrity constraints.

Database Instance
It is important that we distinguish these two terms individually. Database
schema is the skeleton of database. It is designed when the database
doesn't exist at all. Once the database is operational, it is very difficult to
make any changes to it. A database schema does not contain any data or
information.

A database instance is a state of operational database with data at any


given time. It contains a snapshot of the database. Database instances
tend to change with time. A DBMS ensures that its every instance (state)
is in a valid state, by diligently following all the validations, constraints,
and conditions that the database designers have imposed.

A DBMS must provide appropriate languages and interfaces for each category of
users to express database queries and updates. Database Languages are used to
create and maintain database on computer. There are large numbers of database
languages like Oracle, MySQL, MS Access, dBase, FoxPro etc. SQL statements
commonly used in Oracle and MS Access can be categorized as data definition
language (DDL), data control language (DCL) and data manipulation language
(DML).

Data Definition Language (DDL)

It is a language that allows the users to define data and their relationship to other
types of data. It is mainly used to create files, databases, data dictionary and tables
within databases.

It is also used to specify the structure of each table, set of associated values with each
attribute, integrity constraints, security and authorization information for each table
and physical storage structure of each table on disk.

The following table gives an overview about usage of DDL statements in SQL
Data Manipulation Language (DML)

It is a language that provides a set of operations to support the basic data


manipulation operations on the data held in the databases. It allows users to insert,
update, delete and retrieve data from the database. The part of DML that involves
data retrieval is called a query language.

The following table gives an overview about the usage of DML statements in SQL:

Data Control Language (DCL)

DCL statements control access to data and the database using statements such as
GRANT and REVOKE. A privilege can either be granted to a User with the help of
GRANT statement. The privileges assigned can be SELECT, ALTER, DELETE,
EXECUTE, INSERT, INDEX etc. In addition to granting of privileges, you can also
revoke (taken back) it by using REVOKE command.

The following table gives an overview about the usage of DCL statements in SQL:
In practice, the data definition and data manipulation languages are not two separate
languages. Instead they simply form parts of a single database language such as
Structured Query Language (SQL). SQL represents combination of DDL and DML, as
well as statements for constraints specification and schema evaluation.
Two-Tier Architecture:

The two-tier is based on Client Server architecture. The two-tier architecture is like client server application. The direct
communication takes place between client and server. There is no intermediate between client and server. Because of tight
coupling a 2 tiered application will run faster.

Two-Tier Architecture

The above figure shows the architecture of two-tier. Here the direct communication between client and server, there is no
intermediate between client and server.

Lets take a look of real life example of Railway Reservation two-tier architecture:

Lets consider that first Person is making Railway Reservation for Mumbai to Delhi by Mumbai Express at Counter No. 1 and at
same time second Person is also try to make Railway reservation of Mumbai to Delhi from Counter No. 2

If staff from Counter No. 1 is searching for availability into system & at the same staff from Counter No. 2 is also looking for
availability of ticket for same day then in this case there is might be good change of confusion and chaos occurs. There might
be chance of lock the Railway reservation that reserves the first.

But reservations can be making anywhere from the India, then how it is handled?

So here if there is difference of micro seconds for making reservation by staff from Counter No. 1 & 2 then second request is
added into queue. So in this case the Staff is entering data to Client Application and reservation request is sent to the
database. The database sends back the information/data to the client.
In this application the Staff user is an end user who is using Railway reservation application software. He gives inputs to the
application software and it sends requests to Server. So here both Database and Server are incorporated with each other, so
this technology is called as Client-Server Technology.

The Two-tier architecture is divided into two parts:

1) Client Application (Client Tier)


2) Database (Data Tier)

On client application side the code is written for saving the data in the SQL server database. Client sends the request to server
and it process the request & send back with data. The main problem of two tier architecture is the server cannot respond
multiple request same time, as a result it cause a data integrity issue.

Advantages:

1. Easy to maintain and modification is bit easy

2. Communication is faster

Disadvantages:

1. In two tier architecture application performance will be degrade upon increasing the users.

2. Cost-ineffective

Three-Tier Architecture:

Three-tier architecture typically comprise a presentation tier, a business or data access tier, and a data tier. Three layers in
the three tier architecture are as follows:

1) Client layer
2) Business layer
3) Data layer

1) Client layer:

It is also called as Presentation layer which contains UI part of our application. This layer is used for the design purpose where
data is presented to the user or input is taken from the user. For example designing registration form which contains text box,
label, button etc.

2) Business layer:

In this layer all business logic written like validation of data, calculations, data insertion etc. This acts as a interface between
Client layer and Data Access Layer. This layer is also called the intermediary layer helps to make communication faster between
client and data layer.

3) Data layer:

In this layer actual database is comes in the picture. Data Access Layer contains methods to connect with database and to
perform insert, update, delete, get data from database based on our input data.
Three-tier Architecture

Advantages

1. High performance, lightweight persistent objects

2. Scalability Each tier can scale horizontally

3. Performance Because the Presentation tier can cache requests, network utilization is minimized, and the load is
reduced on the Application and Data tiers.

4. High degree of flexibility in deployment platform and configuration

5. Better Re-use

6. Improve Data Integrity

7. Improved Security Client is not direct access to database.

8. Easy to maintain and modification is bit easy, wont affect other modules

9. In three tier architecture application performance is good.

Disadvantages

1. Increase Complexity/Effort

You might also like