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

Database

Uploaded by

Samim Islam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

Database

Uploaded by

Samim Islam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

(Unit-5)

Database Management
System
Data
Data is defined as a collection of meaningful facts which can be stored and processed by
computers or humans. In other words , it is a collection of unorganized facts , concepts or
instructions in a formalized manner . For example: phone numbers, product names, addresses ,
registration numbers etc.

Information
Information is defined as the processed data which helps us in making decisions . It is the
intelligent form of data . For example: timetable, bills, reports, merit list , printed documents.

Knowledge
The sum of information and experience the person has acquired or learned and is able to recall
or use is known as knowledge . For example: “Sia is doing project on banking” is an
information but she has completed 40% of the project is your knowledge that you have gained
through your experience
Database
A database is a system intended to organize, store, and retrieve large
amounts of data easily. It
consists of an organized collection of data for one or more uses, typically in
digital form. One
way of classifying databases involves the type of their contents, for example:
bibliographic,
document-text, statistical. Digital databases are managed using database
management systems,
which store database contents, allowing data creation and maintenance, and
search and other
access.
Computer databases typically contain aggregations of data records or files,
such as sales
transactions, product catalogs and inventories, and customer profiles. Typically,
a database
manager provides users the capabilities of controlling read/write access,
specifying report
Advantages of DBMS

Controls database redundancy: It can control data redundancy


because it stores all the data in one single database file and that
recorded data is placed in the database.
Data sharing: In DBMS, the authorized users of an organization
can share the data among multiple users.
Easily Maintenance: It can be easily maintainable due to the
centralized nature of the database system.
Reduce time: It reduces development time and maintenance
need.
Backup: It provides backup and recovery subsystems which create
automatic backup of data from hardware and software failures and
restores the data if required.
Multiple User Interface: It provides different types of user
interfaces like graphical user interfaces, application program
interfaces.
Disadvantages of DBMS

Cost of Hardware and Software: It requires a high speed


of data processor and large memory size to run DBMS
software.
Size: It occupies a large space of disks and large memory to
run them efficiently.
Complexity: Database system creates additional complexity
and requirements.
Higher impact of failure: Failure is highly impacted the
database because in most of the organization, all the data
stored in a single database and if the database is damaged
due to electric failure or database corruption then the data
may be lost forever.
Architecture of DBMS
1. Query Processor: It interprets the requests (queries) received from end user via an
application program into instructions. It also executes the user request which is received
from the DML compiler.
Query Processor contains the following components –
•DML Compiler: It processes the DML statements into low level instruction (machine
language), so that they can be executed.
•DDL Interpreter: It processes the DDL statements into a set of table containing meta data
(data about data).
•Query Optimizer: It executes the instruction generated by DML Compiler.

2. Storage Manager: Storage Manager is a program that provides an interface between


the data stored in the database and the queries received. It is also known as Database
Control System. It maintains the consistency and integrity of the database by applying the
constraints and executing the DCL statements. It is responsible for updating, storing,
deleting, and retrieving data in the database.
It contains the following components –
•Authorization Manager: It ensures role-based access control, i.e,. checks whether the
particular person is privileged to perform the requested operation or not.

•Integrity Manager: It checks the integrity constraints when the database is modified.
•Transaction Manager: It controls concurrent access by performing the operations in a
scheduled way that it receives the transaction. Thus, it ensures that the database remains in the
consistent state before and after the execution of a transaction.

•File Manager: It manages the file space and the data structure used to represent information in
the database.

•Buffer Manager: It is responsible for cache memory and the transfer of data between the
secondary storage and main memory.

3. Disk Storage: It contains the following components –


•Data Files: It stores the data.

•Data Dictionary: It contains the information about the structure of any database object. It is the
repository of information that governs the metadata.
•Indices: It provides faster retrieval of data item.
The structure of a Database Management System (DBMS) can be divided into three main
components: the Internal Level, the Conceptual Level, and the External Level.

1.Internal Level: This level represents the physical storage of data in the database. It is
responsible for storing and retrieving data from the storage devices, such as hard drives or
solid-state drives. It deals with low-level implementation details such as data compression,
indexing, and storage allocation.

2.Conceptual Level: This level represents the logical view of the database. It deals with the
overall organization of data in the database and the relationships between them. It defines the
data schema, which includes tables, attributes, and their relationships. The conceptual level is
independent of any specific DBMS and can be implemented using different DBMSs.

3.External Level: This level represents the user’s view of the database. It deals with how
users access the data in the database. It allows users to view data in a way that makes sense to
them, without worrying about the underlying implementation details. The external level
provides a set of views or interfaces to the database, which are tailored to meet the needs of
specific user groups.
Types of Database
1) Centralized Database
It is the type of database that stores data at a centralized database system. It comforts the
users to access the stored data from different locations through several applications. These
applications contain the authentication process to let users access data securely. An example
of a Centralized database can be Central Library that carries a central database of each
library in a college/university.
2) Distributed Database
Unlike a centralized database system, in distributed systems, data is distributed among
different database systems of an organization. These database systems are connected via
communication links. Such links help the end-users to access the data easily.
3. Relational Database
This database is based on the relational data model, which stores data in the form of
rows(tuple) and columns(attributes), and together forms a table(relation). A relational database
uses SQL for storing, manipulating, as well as maintaining the data. E.F. Codd invented the
database in 1970. Each table in the database carries a key that makes the data unique from
others. Examples of Relational databases are MySQL, Microsoft SQL Server, Oracle, etc.
4) NoSQL Database
Non-SQL/Not Only SQL is a type of database that is used for storing a wide range of data sets. It
is not a relational database as it stores data not only in tabular form but in several different
ways. It came into existence when the demand for building modern applications increased.
Thus, NoSQL presented a wide variety of database technologies in response to the demands
5) Cloud Database
A type of database where data is stored in a virtual environment and executes over the cloud
computing platform. It provides users with various cloud computing services (SaaS, PaaS, IaaS,
etc.) for accessing the database. There are numerous cloud platforms, but the best options are:
•Amazon Web Services(AWS)
•Microsoft Azure
Database Models
Hierarchical Databases :
Just as in any hierarchy, this database follows the progression of data being categorized in
ranks or levels, wherein data is categorized based on a common point of linkage. As a result,
two entities of data will be lower in rank and the commonality would assume a higher rank
Network Databases
In Layman’s terms, a network database is a hierarchical database, but with a major tweak. The
child records are given the freedom to associate with multiple parent records. As a
result, a network or net of database files linked with multiple threads is observed. Notice how
the Student, Faculty, and Resources elements each have two-parent records, which are
Departments and Clubs.
Object-Oriented Databases :

Those familiar with the Object-Oriented Programming Paradigm would be able to relate to this
model of databases easily. Information stored in a database is capable of being
represented as an object which response as an instance of the database model.
Therefore, the object can be referenced and called without any difficulty. As a result, the
workload on the database is substantially reduced.
Relational Databases :
Considered the most mature of all databases, these databases lead in the production line
along with their management systems. In this database, every piece of information has
a relationship with every other piece of information. This is on account of every data
value in the database having a unique identity in the form of a record.
Note that all data is tabulated in this model. Therefore, every row of data in the database is
linked with another row using a primary key. Similarly, every table is linked with another table
using a foreign key.
What is a database transaction?
A database transaction is a sequence of multiple operations performed on a
database, and all served as a single logical unit of work — taking place wholly or
not at all. In other words, there’s never a case that only half of the operations are
performed and the results saved. When a database transaction is in flight, the
database state may be temporarily inconsistent, but when the transaction is
committed
To explain theor ends, theofchanges
concept are applied.
a database transaction, let us use a typical example
of transferring money between Account A and Account B. Let’s say you want
to move 5 dollars from Account A to Account B. This action can be broken
down into the following simple operations:
1.Create a record to transfer 5 dollars from Account A to Account B. This is
typically called the begin of a database transaction.
2.Read the balance from Account A.
3.Subtract 5 dollars from the balance of Account A.
4.Read the balance from Account B.
5.Add 5 dollars credit to Account B.
How do database transactions work?

Before we learn about how database transactions work, let’s explore why they are
needed in the first place.

1.System failures are inevitable, and in these cases, a transaction provides a way to
ensure that the outcome is reliable and consistent. This means that the state of the
database reflects all transactional changes committed before the point of failure
and that transactions that were in-flight at the failure point are cleanly rolled back.

2.When multiple concurrent requests are hitting the database server, changing the
same underlying data simultaneously, the transaction must isolate requests from
each other to avoid conflicts.
During its lifecycle, a database transaction goes through multiple states. These states are
called transaction states and are typically one of the following:
1.Active states: It is the first state during the execution of a transaction. A transaction
is active as long as its instructions (read or write operations) are performed.
2.Partially committed: A change has been executed in this state, but the database has
not yet committed the change on disk. In this state, data is stored in the memory buffer,
and the buffer is not yet written to disk.
3.Committed: In this state, all the transaction updates are permanently stored in the
database. Therefore, it is not possible to rollback the transaction after this point.
4.Failed: If a transaction fails or has been aborted in the active state or partially committed
state, it enters into a failed state.
5.Terminated state: This is the last and final transaction state after a committed or
aborted state. This marks the end of the database transaction life cycle.

You might also like