DBMS WH

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

What is Database management system?

Explain various application of Database


management system?
Ans:-
• Database Management System is a software or technology used to manage data
from a database. Some popular databases are MySQL, Oracle, MongoDB, etc.
DBMS provides many operations e.g. creating a database, storing in the
database, updating an existing database, delete from the database.
• DBMS is a system that enables you to store, modify and retrieve data in an
organized way. It also provides security to the database.

There are different fields where a database management system is utilized. Following
are a few applications that utilize the information base administration framework.

1. Railway Reservation System:- In the rail route reservation framework, the


information base is needed to store the record or information of ticket appointments,
status of train’s appearance, and flight. Additionally, if trains get late, individuals become
acquainted with it through the information base update.
2. Library Management System:- There are many books in the library so; it is difficult
to store the record of the relative multitude of books in a register or duplicate. Along
these lines, the data set administration framework (DBMS) is utilized to keep up all the
data identified with the name of the book, issue date, accessibility of the book, and its
writer.
3. Banking:- Database the executive’s framework is utilized to store the exchange data
of the client in the information base.
4. Education Sector:- Presently, assessments are led online by numerous schools and
colleges. They deal with all assessment information through the data set administration
framework (DBMS). In spite of that understudy’s enlistments subtleties, grades,
courses, expense, participation, results, and so forth all the data is put away in the
information base.
5. Credit card exchanges:- The database Management framework is utilized for buying
on charge cards and age of month to month proclamations.
6. Accounting and Finance:- The information base administration framework is utilized
for putting away data about deals, holding and acquisition of monetary instruments, for
example, stocks and bonds in a data set.
7. Healthcare System:- DBMS is used in healthcare to manage patient data, medical
records, and billing information.
8. Security:- DBMS provides security features to ensure that only authorized users
have access to the data.
9.Online Shopping :- Now-a-days we all do Online shopping without wasting the time by
going shopping with the help of DBMS. The products are added and sold only with the
help of DBMS like Purchase information, invoice bills and payment.
10.Manufacturing :- Manufacturing companies make products and sell them on a daily
basis. To keep records of all those details DBMS is used.

Explain level of data abstraction in DBMS


Ans:-
terms of retrieval of data, and reduce complexity in terms of usability of users,
developers use abstraction i.e. hide irrelevant details from the users. This approach
simplifies database design.
Level of Abstraction in a DBMS
There are mainly 3 levels of data abstraction:
Physical or Internal Level
Logical or Conceptual Level
View or External Level

1. Physical or Internal Level


• This is the lowest level of data abstraction. It tells us how the data is actually
stored in memory. Access methods like sequential or random access and file
organization methods like B+ trees and hashing are used for the same. Usability,
size of memory, and the number of times the records are factors that we need to
know while designing the database.
• Suppose we need to store the details of an employee. Blocks of storage and the
amount of memory used for these purposes are kept hidden from the user.

2. Logical or Conceptual Level


• This level comprises the information that is actually stored in the database in the
form of tables. It also stores the relationship among the data entities in relatively
simple structures. At this level, the information available to the user at the view
level is unknown.
• We can store the various attributes of an employee and relationships, e.g. with
the manager can also be stored.

3. View or External Level


• This is the highest level of abstraction. Only a part of the actual database is
viewed by the users. This level exists to ease the accessibility of the database by
an individual user. Users view data in the form of rows and columns. Tables and
relations are used to store data. Multiple views of the same database may exist.
Users can just view the data and interact with the database, storage and
implementation details are hidden from them.

Example: In case of storing customer data,


Physical level – it will contains block of storages (bytes,GB,TB,etc)
Logical level – it will contain the fields and the attributes of data.
View level – it works with CLI or GUI access of database

Data Abstraction
The main purpose of data abstraction is to achieve data independence in order to save
the time and cost required when the database is modified or altered.

What is data independence ? Explain types of data independence ?

Ans:-
• Data independence can be explained using the three-schema architecture.
• Data independence refers characteristic of being able to modify the schema at one
level of the database system without altering the schema at the next higher level.

There are two types of data independence:

1. Logical Data Independence


o Logical data independence refers characteristic of being able to change the
conceptual schema without having to change the external schema.
o Logical data independence is used to separate the external level from the
conceptual view.
o If we do any changes in the conceptual view of the data, then the user view of the
data would not be affected.
o Logical data independence occurs at the user interface level.

2. Physical Data Independence


o Physical data independence can be defined as the capacity to change the internal
schema without having to change the conceptual schema.
o If we do any changes in the storage size of the database system server, then the
Conceptual structure of the database will not be affected.
o Physical data independence is used to separate conceptual levels from the internal
levels.
o Physical data independence occurs at the logical interface level.
Differentiate between data and information.
Ans:-
Data :-
1. Collection of facts and figure.
2. No conclusion can be drawn on data.
3. Data cannot be used for decision making.
4. Data is a raw material for processing.
5. It is not time bound.

Information :-
1. Processed form of data.
2. Used for conclusion can be drawn .
3. Plays important role in decision making.
4. Information can also be further utilized to produce highly densified information.
5. It is time bound.

Explain 2-tier,3-tier, N-tier architecture of DBMS ?


Ans:-

2-Tier:-

The 2-tier Architecture is based on a client-server machine.

In this type of architecture, the applications on client-side interact directly with the
database present at the server-side.

This interaction between client and server uses Application Program Interface like ODBC
and JDBC.

• ODBC − Open Database Connectivity


• JDBC − Java Database Connectivity

When there are a large number of users at client side to access the database, this
architecture gives a poor performance.

The server side is responsible for delivering the functionalities like query processing and
management of transactions.

For example − Oracle, Sybase, Microsoft SQL Server etc.


The Tier-2 architecture of DBMS is diagrammatically represented as follows −

3-Tier :-

The 3-tier architecture contains one more layer between the client and the server.

• In this architecture, there is no direct communication between client and server.


• Mainly, the 3-tier is used for large applications on the web.
• The features of 3-tier architecture are data backup, recovery, security, and
concurrency control.

Layers

The 3-tier architecture consists of the three layers as follows −

• Presentation layer − This layer is also called the client layer. The front-end layer
consists of a user interface. The main purpose is to communicate with the
application layer.
• Application layer − This layer is also called the business logic layer. It acts as a
middle layer between the client and the database server which are used to
exchange partially processed data.
• Database layer − In this layer the data or information is stored. This layer performs
operations like insert, update and delete to connect with the database.

N-Tier :-

• N-tier architecture is also called multi-tier architecture because the software is


engineered to have the processing, data management, and presentation
functions physically and logically separated.

• That means that these different functions are hosted on several machines or
clusters, ensuring that services are provided without resources being shared and,
as such, these services are delivered at top capacity. The “N” in the name n-tier
architecture refers to any number from 1.

N-tier architecture would involve dividing an application into three different tiers. These
would be the

• logic tier,
• the presentation tier, and
• the data tier
Explain DBMS architecture

Ans:-
• A database system is partitioned into modules that deal with each of the
responsibilities of the overall system
• The functional components of a database system can be broadly divided into -
the storage manager, - the query processor components, - the transaction
management component

Storage Manager :-

• A program module that provides the interface between the lowlevel data stored in
the database and the application programs and queries submitted to the system.
• The storage manager is responsible to the following tasks: – Interaction with the
OS file manager – Efficient storing, retrieving and updating of data
• The storage manager components include: – Authorization and integrity manager
– Transaction manager – File manager – Buffer manager

• Authorization and integrity manager :-


which tests for the satisfaction of integrity constraints and checks the authority of
users to access data.
• Transaction manager:-
which ensures that the database remains in a consistent (correct) state despite
system failures, and that concurrent transaction executions proceed without
conflicts.
• File manager:- which manages the allocation of space on disk storage and the
data structures used to represent information stored on disk.
• Buffer manager:-
which is responsible for fetching data from disk storage into main memory, and
deciding what data to cache in main memory. The buffer manager is a critical
part of the database system, since it enables the database to handle data sizes
that are much larger than the size of main memory. Storage Manager • The
storage manager implements several data structures as part.
• The storage manager implements several data structures as part of the physical
system implementation: –
1. Data files -- store the database itself –
2. Data dictionary -- stores metadata about the structure of the database, in
particular the schema of the database.
3. Indices -- can provide fast access to data items. A database index provides
pointers to those data items that hold a particular value.
Transaction Management-

• A transaction is a collection of operations that performs a single logical function


in a database application.
• Each transaction is a unit of both atomicity and consistency. Thus, we require
that transactions do not violate any database-consistency constraints.
• That is, if the database was consistent when a transaction started, the database
must be consistent when the transaction successfully terminates.

The query processor components include: -


• DDL interpreter:-
which interprets DDL statements and records the definitions in the data
dictionary.
• DML compiler:-
which translates DML statements in a query language into an evaluation plan
consisting of lowlevel instructions that the query-evaluation engine understands.
• A query can usually be translated into any of a number of alternative evaluation
plans that all give the same result. The DML compiler also performs query
optimization; that is, it picks the lowest cost evaluation plan from among the
alternatives.
• Query evaluation engine:-
which executes low-level instructions generated by the DML compiler.
• Naive users:- are unsophisticated users who interact with the system by using
predefined user interfaces, such as web or mobile applications. The typical user
interface for naive users is a forms interface, where the user can fill in
appropriate fields of the form. Naive users may also view read reports generated
from the database.
• Application programmers:- are computer professionals who write application
programs. Application programmers can choose from many tools to develop user
interfaces.
• Sophisticated users:- interact with the system without writing programs. Instead,
they form their requests either using a database query language or by using tools
such as data analysis software. Analysts who submit queries to explore data in
the database fall in this category.
• Database Administrator : -One of the main reasons for using DBMSs is to have
central control of both the data and the programs that access those data. A
person who has such central control over the system is called a database
administrator (DBA).
1. Schema definition. The DBA creates the original database schema by
executing a set of data definition statements in the DDL.
2. Storage structure and access-method definition. The DBA may specify
some parameters pertaining to the physical organization of the data and
the indices to be created.
3. Schema and physical-organization modification. The DBA carries out
changes to the schema and physical organization to reflect the changing
needs of the organization, or to alter the physical organization to improve
performance.
4. Routine maintenance : ° Periodically backing up the database onto
remote servers, to prevent loss of data in case of disasters such as
flooding. ° Ensuring that enough free disk space is available for normal
operations, and upgrading disk space as required. ° Monitoring jobs
running on the database and ensuring that performance is not degraded
by very expensive tasks submitted by some users.

Short Note :
a) Transaction Server:-
• Transaction servers which are widely used in relational database systems.
• It provide an interface to which clients can send requests to perform an
action, in response to which they execute the action and send back results
to the client. Transaction – Server Systems :
• Usually, client machines ship transactions to the server systems, where
those transactions are executed, and results are shipped back to clients
that are in charge of displaying the data.
• Requests may be specified by using SQL, or through a specialized
application program interface.

• Server processes: -
1. These are processes that receive user queries (transactions),
execute them, and send the results back. The queries may be
submitted to the server processes from a user interface, or from a
user process running embedded SQL, or via JDBC, ODBC, or
similar protocols.
2. Some database systems use a separate process for each user
session, and a few use a single database process for all user
sessions, but with multiple threads so that multiple queries can
execute concurrently.
3. (A thread is similar to a process, but multiple threads execute as
part of the same process, and all threads within a process run in
the same virtual-memory space. Multiple threads within a process
can execute concurrently.
• Lock manager process: This process implements lock manager
functionality, which includes lock grant, lock release, and deadlock
detection.
• Database writer process: There are one or more processes that output
modified buffer blocks back to disk on a continuous basis.
• Log writer process: This process outputs log records from the log record
buffer to stable storage. Server processes simply add log records to the
log record buffer in shared memory, and if a log force is required, they
request the log writer process to output log records (recall that a log force
causes the log contents in memory to be output to stable storage).
• Checkpoint process: This process performs periodic checkpoints
b) Data Server:-
• Data servers, used in object-oriented database systems (OODBMS).
• It allow clients to interact with the servers by making requests to read or
update data, in units such as files or pages.
• For example, file servers provide a file-system interface where clients can
create, update, read, and delete files.
• They support units of data—such as pages, tuples, or objects—that are
smaller than a file.
• They provide indexing facilities for data, and provide transaction facilities
so that the data are never left in an inconsistent state if a client machine or
process fails.
• Data-server systems are used in local-area networks.
• High-speed connection between the clients and the server.
• It makes sense to ship data to client machines, to perform all processing
at the client machine and then to ship the data back to the server
machine.
• Data-server architectures have been particularly popular in object-oriented
database systems.
c) Cloud Server:-
• A cloud server is a logical server that is built, hosted and delivered through
a cloud computing platform over the Internet. Cloud servers possess and
exhibit similar capabilities and functionality to a typical server but are
accessed remotely from a cloud service provider.
• Cloud servers have all the software they require to run and can function as
independent units.
• Servers are usually owned by the enterprise providing the service, but
there is an increasing trend for service providers to rely at least in part
upon servers that are owned by a “third party” that is neither the client nor
the service provider.
• One model for using third-party servers is to outsource the entire service
to another company that hosts the service on its own computers using its
own software. This allows the service provider to ignore most details of
technology and focus on the marketing of the service.
• Second model for using third-party servers is cloud computing, in which
the service provider runs its own software, but runs it on computers
provided by another company.
Under this model, the third party does not provide any of the application
software; it provides only a collection of machines.
These machines are not “real” machines, but rather simulated by software
that allows a single real computer to simulate several independent
computers. Such simulated machines are called virtual machines.
• A third model uses a cloud computing service as a data server. A number
of systems for data storage on the cloud have been developed and
deployed over the past few years to address data management
requirements.
• Cloud computing is a general term for anything that involves delivering
hosted services over the Internet. A cloud can be Private, Public or Hybrid.
Cloud Server Advantages :-
1] Flexibility and scalability : Extra resource can be accessed as and when
required.
2] Cost-effectiveness : It is available when needed, clients only pay for
what they are using at a particular time.
3] Ease of set up : Cloud servers do not require much initial setup.
4] Reliability : due to the number of available servers, if there are problems
with some, the resource will be shifted so that clients are unaffected.
What is DBMS ? Explain characteristics of DBMS ?
Ans:-
A DBMS is a software that allows creation, definition and manipulation of database,
allowing users to store, process and analyse data easily.
• DBMS provides us with an interface or a tool, to perform various operations like
creating database, storing data in it, updating data, creating tables in the database and
a lot more.
• DBMS also provides protection and security to the databases. • It also
maintains data consistency in case of multiple users.
Here are some examples of popular DBMS used these days:
a) MySql
b) Oracle
c) SQL Server
d) IBM DB2
e) PostgreSQL
f) Amazon SimpleDB (cloud based) etc.

A database management system has following characteristics:


1. Data stored into Tables:- Data is never directly stored into the database. Data is
stored into tables, created inside the database.

DBMS also allows to have relationships between tables which makes the data
more meaningful and connected. You can easily understand what type of data
is stored where by looking at all the tables created in a database.

2. Reduced Redundancy:- In the modern world hard drives are very cheap, but
earlier when hard drives were too expensive, unnecessary repetition of data in
database was a big problem. But DBMS follows Normalisation which divides
the data in such a way that repetition is minimum.

3. Data Consistency:- On Live data, i.e. data that is being


continuosly updated and added, maintaining the consistency of data can
become a challenge. But DBMS handles it all by itself.

4. Support Multiple user and Concurrent Access:- DBMS allows multiple


users to work on it(update, insert, delete data) at the same time and still
manages to maintain the data consistency.
5. Query Language:- DBMS provides users with a simple Query language,
using which data can be easily fetched, inserted, deleted and updated in a
database.

6. Security:- The DBMS also takes care of the security of data, protecting the
data from un-authorised access. In a typical DBMS, we can create user
accounts with different access permissions, using which we can easily
secure our data by restricting user access.

7. DBMS supports transactions, which allows us to better handle


and manage data integrity in real world applications where multi threading is
extensively used.

You might also like