Introduction Dbms Unit1
Introduction Dbms Unit1
UNIT-I
Database
A database is an organized collection of data. It is the collection of schemas, tables, queries,
reports, views and other objects. The data is typically organized to model aspects of reality in a
way that supports processes requiring information, such as modelling the availability of rooms in
hotels in a way that supports finding a hotel with vacancies.
There are a number of characteristics that distinguish the database approach with the file-based
approach.
Self-Describing Nature of a Database System
A Database System contains not only the database itself but also the descriptions of data
structure and constraints (meta-data). This information is used by the DBMS software or
database users if needed. This separation makes a database system totally different from the
traditional file-based system in which the data definition is a part of application programs.
[Type text]
[Type text]
In the Database approach, ideally each data item is stored in only one place in the database. In
some cases redundancy still exists so as to improve system performance, but such redundancy is
controlled and kept to minimum.
Data Sharing
The integration of the whole data in an organization leads to the ability to produce more
information from a given amount of data.
Data Independence
System data (Meta Data) descriptions are separated from the application programs. Changes to
the data structure is handled by the DBMS and not embedded in the program.
Transaction Processing
The DBMS must include concurrency control subsystems to ensure that several users trying to
update the same data do so in a controlled manner. The results of any updates to the database
must maintain consistency and validity.
Managing information
Managing information means taking care of it so that it works for us, and is useful for the work
we are doing. The information we collect is no longer subject to “accidental disorganization”
[Type text]
[Type text]
and becomes more easily accessible and integrated with the rest of our work. Managing
information using a database allows us to become strategic users of the data we have.
Data Models
Data models define how the logical structure of a database is modeled. Data Models are
fundamental entities to introduce abstraction in a DBMS. Data models define how data is
connected to each other and how they are processed and stored inside the system.
The very first data model could be flat data-models, where all the data used are to be kept in the
same plane. Earlier data models were not so scientific, hence they were prone to introduce lots
of duplication and update anomalies.
Entity-Relationship Model
Entity-Relationship (ER) Model is based on the notion of real-world entities and relationships
among them. While formulating real-world scenario into the database model, the ER Model
creates entity set, relationship set, general attributes and constraints.
ER Model is based on −
[Type text]
[Type text]
Mapping cardinalities −
o one to one
o one to many
o many to one
o many to many
Relational Model
The most popular data model in DBMS is the Relational Model. It is more scientific a model
than others. This model is based on first-order predicate logic and defines a table as an n-ary
relation.
[Type text]
[Type text]
DBMS - Architecture
The design of a DBMS depends on its architecture. It can be centralized or decentralized or
hierarchical. The architecture of a DBMS can be seen as either single tier or multi-tier. An n-tier
architecture divides the whole system into related but independent n modules, which can be
independently modified, altered, changed, or replaced.
In 1-tier architecture, the DBMS is the only entity where the user directly sits on the DBMS and
uses it. Any changes done here will directly be done on the DBMS itself. It does not provide
handy tools for end-users. Database designers and programmers normally prefer to use single-
tier architecture.
If the architecture of DBMS is 2-tier, then it must have an application through which the DBMS
can be accessed. Programmers use 2-tier architecture where they access the DBMS by means of
an application. Here the application tier is entirely independent of the database in terms of
operation, design, and programming.
3- tier Architecture
A 3-tier architecture separates its tiers from each other based on the complexity of the users and
how they use the data present in the database. It is the most widely used architecture to design a
DBMS.
[Type text]
[Type text]
• Database (Data) Tier − At this tier, the database resides along with its query processing
languages. We also have the relations that define the data and their constraints at this
level.
• Application (Middle) Tier − At this tier reside the application server and the programs
that access the database. For a user, this application tier presents an abstracted view of the
database. End-users are unaware of any existence of the database beyond the application.
At the other end, the database tier is not aware of any other user beyond the application
tier. Hence, the application layer sits in the middle and acts as a mediator between the
end-user and the database.
• User (Presentation) Tier − End-users operate on this tier and they know nothing about
any existence of the database beyond this layer. At this layer, multiple views of the
database can be provided by the application. All views are generated by applications that
reside in the application tier.
Multiple-tier database architecture is highly modifiable, as almost all its components are
independent and can be changed independently.
Data Independence
If a database system is not multi-layered, then it becomes difficult to make any changes in the
A database system normally contains a lot of data in addition to users’ data. For example, it
stores data about data, known as metadata, to locate and retrieve data easily. It is rather difficult
to modify or update a set of metadata once it is stored in the database. But as a DBMS expands,
it needs to change over time to satisfy the requirements of the users. If the entire data is
dependent, it would become a tedious and highly complex job.
[Type text]
[Type text]
Metadata itself follows a layered architecture, so that when we change data at one layer, it does
not affect the data at another level. This data is independent but mapped to each other.
Logical data independence is a kind of mechanism, which liberalizes itself from actual data
stored on the disk. If we do some changes on table format, it should not change the data residing
on the disk.
For example, in case we want to change or upgrade the storage system itself − suppose we want
to replace hard-disks with SSD − it should not have any impact on the logical data or schemas.
[Type text]