0% found this document useful (0 votes)
21 views

DBMS unit-1

DBMs unit notes

Uploaded by

gv892696
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

DBMS unit-1

DBMs unit notes

Uploaded by

gv892696
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

DATA BASE MANAGEMENT SYSTEM

Unit I DBMS Concepts and architecture Introduction, Database approach v/s Traditional file accessing approach,
Advantages, of database systems, Data models, Schemas and instances, Data independence, Data Base Language
and interfaces, Overall Database Structure, Functions of DBA and designer, ER data model: Entitles and attributes,
Entity types, Defining the E-R diagram, Concept of Generalization, Aggregation and Specialization. transforming ER
diagram into the tables. Various other data models object oriented data Model, Network data model, and Relational
data model, Comparison between the three types of models

Difference between Data Redundancy and Data


Inconsistency
Overview :
Data Redundancy and Data Inconsistency are the important terms used in the Database.
A good Database Design is the one in which there is minimum Data Redundancy and
Data Inconsistency. In this article, we will tell what are these two terms and what is the
difference between them.
Data Redundancy :
It is defined as the redundancy means duplicate data and it is also stated that the same
parts of data exist in multiple locations into the database. This condition is known as Data
Redundancy.
Problems with Data Redundancy :
Here, we will discuss the few problems with data redundancy as follows.

1. Wasted Storage Space.


2. More Difficult Database Update.
3. It will lead to Data Inconsistency.
4. Retrieval of data is slow and inefficient.
Example –
Let us take an example of a cricket player table.
Step-1 :
Consider cricket player table as follows.
Player Name Player Age Team Name Team ID

Virat Kohli 32 India 1

Rohit Sharma 34 India 1

Ross Taylor 37 New Zealand 2

Shikhar Dhawan 35 India 1

Kane Williamson 30 New Zealand 2

Step-2 :
We can clearly see that the Team Name and Team Id are repeated at multiple places. we
can make a separate table to store this information and reduce data redundancy.
Player Name Player Age Team Id

Virat Kohli 32 1

Rohit Sharma 34 1

Ross Taylor 37 2

Shikhar Dhawan 35 1

Kane
30 2
Williamson

Step-3 :
This is known as Normalization used to reduce Data Redundancy.
Team Id Team Name

1 India

2 New Zealand

Data Inconsistency :
When the same data exists in different formats in multiple tables. This condition is known
as Data Inconsistency. It means that different files contain different information about a
particular object or person. This can cause unreliable and meaningless information. Data
Redundancy leads to Data Inconsistency.
Example –
If we have an address of someone in many tables and when we change it in only

one table and in another table it may not be updated so there is the problem of data
inconsistency may occur.
Differences :
Topic Data Redundancy Data Inconsistency

It will be applicable when the duplicate It will be applicable when the duplicate
data exists in multiple places in the data exists in different formats in multiple
Condition database. tables.

How to we can use normalization to minimize we can use constraints on the database to
minimize it? Data Redundancy. minimize Data Inconsistency.
What is Data Redundancy?
Data redundancy occurs when the same piece of data is stored in two or more separate places and is a common
occurrence in many businesses. As more companies are moving away from siloed data to using a central repository
to store information, they are finding that their database is filled with inconsistent duplicates of the same entry.
Although it can be challenging to reconcile — or even benefit from — duplicate data entries, understanding how to
reduce and track data redundancy efficiently can help mitigate long-term inconsistency issues for your business.

Watch out for data redundancy disadvantages

Although there are noteworthy advantages of intentional data redundancy, there are also several significant
drawbacks when organizations are unaware of its presence.

Possible data inconsistency

Data redundancy occurs when the same piece of data exists in multiple places, whereas data inconsistency is
when the same data exists in different formats in multiple tables. Unfortunately, data redundancy can cause data
inconsistency, which can provide a company with unreliable and/or meaningless information.

Increase in data corruption

Data corruption is when data becomes damaged as a result of errors in writing, reading, storage, or processing.
When the same data fields are repeated in a database or file storage system, data corruption arises. If a file gets
corrupted, for example, and an employee tries to open it, they may get an error message and not be able to
complete their task.

Increase in database size

Data redundancy may increase the size and complexity of a database — making it more of a challenge to maintain.
A larger database can also lead to longer load times and a great deal of headaches and frustrations for employees
as they’ll need to spend more time completing daily tasks.

Increase in cost

When more data is created due to data redundancy, storage costs suddenly increase. This can be a serious issue
for organizations who are trying to keep costs low in order to increase profits and meet their goals. In addition,
implementing a database system can become more expensive.

Short Note on Data Dictionary


A Data Dictionary comprises two words i.e. Data which simply means information being
collected through some sources and Dictionary means where this information is
available.
A Data Dictionary can be defined as a collection of information on all data elements or
contents of databases such as data types, and text descriptions of the system. It makes it
easier for users and analysts to use data as well as understand and have common
knowledge about inputs, outputs, components of a database, and intermediate
calculations.

Types of Data Dictionary


Data Dictionary is basically of two types. We will discuss each of them.
 Integrated Data Dictionary
 Stand Alone Data Dictionary
1. Integrated Data Dictionary
Integrated Data Dictionary can be seen as a catalog that can be maintained by the
relational database. In previous databases, there is not any functionality of Integrated
Data Dictionary, so they use Stand Alone Data Dictionary.
There are two types of Integrated Data Dictionary.

 Active Data Dictionary: Active Database Dictionary is a type of database that is


updated automatically in case any changes are to be done to the database. These are
self-updating.
 Passive Data Dictionary: Passive Databases are the databases that have to be
maintained or updated manually in case of any changes have been made to the
system.
2. Stand Alone Data Dictionary
Stand Alone Data Dictionary is a type of flexible data dictionary as Database
Administrator has ease of managing data. It does not require data that is computer-
based. It has no fixed format. But some elements are common in this kind of database.

 Data Elements: It has the elements like name, datatype, validation rules, etc.
 Tables: These contain all the necessary information that is required for the table, how
many rows in the table, how many columns in the table, etc.
 Index: The index of the databases is to be stored here.
 Programs: These are used for accessing the database, and can include SQL
Queries, Reports, etc.
 Relationship between Data Elements: This stores the relationship among the
different databases, like cardinality, connectivity, etc.

What Does Data Dictionary Mean?

A data dictionary is a file or a set of files that contains a database's metadata. The
data dictionary contains records about other objects in the database, such as data
ownership, data relationships to other objects, and other data.

The data dictionary is a crucial component of any relational database. It provides


additional information about relationships between different database tables, helps to
organize data in a neat and easily searchable way, and prevents data redundancy
issues.

Ironically, because of its importance, it is invisible to most database users. Typically,


only database administrators interact with the data dictionary.

A data dictionary is also called a metadata repository


Difference Between Two-Tier And Three-Tier
database architecture
1. Two-Tier Database Architecture –
In two-tier, the application logic is either buried inside the User Interface on the client or
within the database on the server (or both). With two-tier client/server architectures, the
user system interface is usually located in the user’s desktop environment and the
database management services are usually in a server that is a more powerful machine
that services many clients.
2. Three-Tier Database Architecture –
In three-tier, the application logic or process lives in the middle-tier, it is separated from
the data and the user interface. Three-tier systems are more scalable, robust and
flexible. In addition, they can integrate data from multiple sources. In the three-tier
architecture, a middle tier was added between the user system interface client
environment and the database management server environment. There are a variety of
ways of implementing this middle tier, such as transaction processing monitors, message
servers, or application servers.

Difference Between Two-Tier And Three-Tier Database Architecture


Three-Tier Database
S.NO Two-Tier Database Architecture Architecture

1 It is a Client-Server Architecture. It is a Web-based application.

In two-tier, the application logic is In three-tier, the application logic or


either buried inside the user interface process resides in the middle-tier, it
2
on the client or within the database on is separated from the data and the
the server (or both). user interface.

Two-tier architecture consists of two Three-tier architecture consists of


3 layers : Client Tier and Database three layers : Client Layer, Business
(Data Tier). Layer and Data Layer.

4 It is easy to build and maintain. It is complex to build and maintain.

5 Two-tier architecture runs slower. Three-tier architecture runs faster.

It is secured as client is not allowed


It is less secured as client can
6 to communicate with database
communicate with database directly.
directly.

It results in performance loss


It results in performance loss whenever the system is run on
7
whenever the users increase rapidly. Internet but gives more performance
than two-tier architecture.
Example – Designing registration
Example – Contact Management
form which contains text box, label,
8 System created using MS-Access or
button or a large website on the
Railway Reservation System, etc.
Internet, etc

database system architecture


A Database stores a lot of critical information to access data quickly and securely. Hence
it is important to select the correct architecture for efficient data management. DBMS
Architecture helps users to get their requests done while connecting to the database. We
choose database architecture depending on several factors like the size of the database,
number of users, and relationships between the users. There are two types of database
models that we generally use, logical model and physical model. Several types of
architecture are there in the database which we will deal with in the next section.

Types of DBMS Architecture


There are several types of DBMS Architecture that we use according to the usage
requirements. Types of DBMS Architecture are discussed here.
 1-Tier Architecture
 2-Tier Architecture
 3-Tier Architecture

1-Tier Architecture
In 1-Tier Architecture the database is directly available to the user, the user can directly
sit on the DBMS and use it that is, the client, server, and Database are all present on the
same machine. For Example: to learn SQL we set up an SQL server and the database on
the local system. This enables us to directly interact with the relational database and
execute operations. The industry won’t use this architecture they logically go for 2-tier
and 3-tier Architecture.

Advantages of 1-Tier Architecture


Below mentioned are the advantages of 1-Tier Architecture

 Simple Architecture: 1-Tier Architecture is the most simple architecture to set up, as
only a single machine is required to maintain it.
 Cost-Effective: No additional hardware is required for implementing 1-Tier
Architecture, which makes it cost-effective.
 Easy to Implement: 1-Tier Architecture can be easily deployed, and hence it is
mostly used in small projects.
2-Tier Architecture
The 2-tier architecture is similar to a basic client-server model. The application at the
client end directly communicates with the database on the server side. APIs like ODBC
and JDBC are used for this interaction. The server side is responsible for providing query
processing and transaction management functionalities. On the client side, the user
interfaces and application programs are run. The application on the client side
establishes a connection with the server side to communicate with the DBMS.

An advantage of this type is that maintenance and understanding are easier, and
compatible with existing systems. However, this model gives poor performance when
there are a large number of users.

Advantages of 2-Tier Architecture


 Easy to Access: 2-Tier Architecture makes easy access to the database, which
makes fast retrieval.
 Scalable: We can scale the database easily, by adding clients or upgrading hardware.
 Low Cost: 2-Tier Architecture is cheaper than 3-Tier Architecture and Multi-Tier
Architecture.
 Easy Deployment: 2-Tier Architecture is easier to deploy than 3-Tier Architecture.
 Simple: 2-Tier Architecture is easily understandable as well as simple because of
only two components.

3-Tier Architecture
In 3-Tier Architecture, there is another layer between the client and the server. The client
does not directly communicate with the server. Instead, it interacts with an application
server which further communicates with the database system and then the query
processing and transaction management takes place. This intermediate layer acts as a
medium for the exchange of partially processed data between the server and the client.
This type of architecture is used in the case of large web applications.
Advantages of 3-Tier Architecture
 Enhanced scalability: Scalability is enhanced due to the distributed deployment of
application servers. Now, individual connections need not be made between the client
and server.
 Data Integrity: 3-Tier Architecture maintains Data Integrity. Since there is a middle
layer between the client and the server, data corruption can be avoided/removed.
 Security: 3-Tier Architecture Improves Security. This type of model prevents direct
interaction of the client with the server thereby reducing access to unauthorized data.
Disadvantages of 3-Tier Architecture
 More Complex: 3-Tier Architecture is more complex in comparison to 2-Tier
Architecture. Communication Points are also doubled in 3-Tier Architecture.
 Difficult to Interact: It becomes difficult for this sort of interaction to take place due to
the presence of middle layers.

DBMS Architecture
 The DBMS design depends upon its architecture. The basic client/server architecture is
used to deal with a large number of PCs, web servers, database servers and other
components that are connected with networks.
 The client/server architecture consists of many PCs and a workstation which are
connected via the network.
 DBMS architecture depends upon how users are connected to the database to get their
request done.
Types of DBMS Architecture

Database architecture can be seen as a single tier or multi-tier. But logically, database
architecture is of two types like: 2-tier architecture and 3-tier architecture.

1-Tier Architecture
o In this architecture, the database is directly available to the user. It means the user can
directly sit on the DBMS and uses it.
o Any changes done here will directly be done on the database itself. It doesn't provide a
handy tool for end users.
o The 1-Tier architecture is used for development of the local application, where
programmers can directly communicate with the database for the quick response.

2-Tier Architecture
o The 2-Tier architecture is same as basic client-server. In the two-tier architecture,
applications on the client end can directly communicate with the database at the server
side. For this interaction, API's like: ODBC, JDBC are used.
o The user interfaces and application programs are run on the client-side.

o The server side is responsible to provide the functionalities like: query processing and
transaction management.
o To communicate with the DBMS, client-side application establishes a connection
with the server side.
o

o Fig: 2-tier Architecture

3-Tier Architecture
o The 3-Tier architecture contains another layer between the client and server. In this
architecture, client can't directly communicate with the server.
o The application on the client-end interacts with an application server which further
communicates with the database system.
o End user has no idea about the existence of the database beyond the application
server. The database also has no idea about any other user beyond the application.
o The 3-Tier architecture is used in case of large web application.

Fig: 3-tier Architecture


Introduction of DBMS (Database Management
System)
A Database Management System (DBMS) is a software system that is designed to
manage and organize data in a structured manner. It allows users to create, modify, and
query a database, as well as manage the security and access controls for that database.
Key Features of DBMS
 Data modeling: A DBMS provides tools for creating and modifying data models,
which define the structure and relationships of the data in a database.
 Data storage and retrieval: A DBMS is responsible for storing and retrieving data
from the database, and can provide various methods for searching and querying the
data.
 Concurrency control: A DBMS provides mechanisms for controlling concurrent
access to the database, to ensure that multiple users can access the data without
conflicting with each other.
 Data integrity and security: A DBMS provides tools for enforcing data integrity and
security constraints, such as constraints on the values of data and access controls
that restrict who can access the data.
 Backup and recovery: A DBMS provides mechanisms for backing up and recovering
the data in the event of a system failure.
 DBMS can be classified into two types: Relational Database Management System
(RDBMS) and Non-Relational Database Management System (NoSQL or Non-SQL)
 RDBMS: Data is organized in the form of tables and each table has a set of rows and
columns. The data are related to each other through primary and foreign keys.

 NoSQL: Data is organized in the form of key-value pairs, documents, graphs, or


column-based. These are designed to handle large-scale, high-performance
scenarios.
A database is a collection of interrelated data which helps in the efficient retrieval,
insertion, and deletion of data from the database and organizes the data in the form of
tables, views, schemas, reports, etc. For Example, a university database organizes the
data about students, faculty, admin staff, etc. which helps in the efficient retrieval,
insertion, and deletion of data from it.

Database Languages
 Data Definition Language
 Data Manipulation Language
 Data Control Language
 Transactional Control Language

Data Definition Language

DDL is the short name for Data Definition Language, which deals with database schemas
and descriptions, of how the data should reside in the database.
 CREATE: to create a database and its objects like (table, index, views, store
procedure, function, and triggers)
 ALTER: alters the structure of the existing database
 DROP: delete objects from the database
 TRUNCATE: remove all records from a table, including all spaces allocated for the
records are removed

You might also like