DBMS unit-1
DBMS unit-1
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
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.
Although there are noteworthy advantages of intentional data redundancy, there are also several significant
drawbacks when organizations are unaware of its presence.
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.
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.
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.
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.
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.
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.
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
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.
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