DBMS-Chapter-1
DBMS-Chapter-1
Database Management System (DBMS) is a software application that is used to create, access,
maintain, and manage databases.
Storage: According to the principles of database systems, the data is stored in such a way that it
acquires lot less space as the redundant data (duplicate data) has been removed before storage.
Let’s take a layman example to understand this:
In a banking system, suppose a customer is having two accounts, one is saving account and
another is salary account. Let’s say bank stores saving account data at one place (these places are
called tables we will learn them later) and salary account data at another place, in that case if the
customer information such as customer name, address etc. are stored at both places then this is
just a wastage of storage (redundancy/ duplication of data), to organize the data in a better way
the information should be stored at one place and both the accounts should be linked to that
information somehow. The same thing we achieve in DBMS.
Fast Retrieval of data: Along with storing the data in an optimized and systematic manner, it is
also important that we retrieve the data quickly when needed. Database systems ensure that the
data is retrieved as quickly as possible.
Post-2000: NoSQL It refers to “not only SQL” databases that use other query languages
to store and retrieve data.
Hierarchical database
Network database
Relational database
Object-Oriented database
Hierarchical DBMS
The network database model allows each child to have multiple parents. It helps you to address
the need to model more complex relationships like as the orders/parts many-to-many relationship.
In this model, entities are organized in a graph which can be accessed through several paths.
The main difference between the hierarchical model and the network model is that the network
model allows each record to have more than one parent and child record. In fig. 2, the “Client”,
“Supervisor” and other boxes represent what in database terminology are called entities. The
network model allows entities to have relationships, just like in real life. In the example, an order
involves a customer, supervisor and worker — as it would if a client walked into a store and
bought a product.
Relational Model
The relational model describes the data in a database as being stored in tables, each containing
records with fields. An example could be a customer table, which could include the following
fields:
Customer:
customer id,
first name,
last name,
street address,
city,
county,
postcode,
mobile
Relational DBMS is the most widely used DBMS model because it is one of the easiest. This
model is based on normalizing data in the rows and columns of the tables.
These tables can have relationships in a relational database, and different types of relationships
exist. They include, One-to-One, One-to-Many, Many-to-Many.
These allow the designer to show how one table relates to another. For example, a customer will
probably buy many products. Therefore one customer can be associated with many products (this
is a one-to-many relationship).
Most relational databases use a standard method for accessing the data: the Structured Query
Language (SQL).
The model implements a set of constraints and these ensure that the database functions as
intended.
Object-Oriented Model
In Object-oriented Model data is stored in the form of objects. The structure which is called
classes which display data within it.
It is one of the components of DBMS that defines a database as a collection of objects which
stores both data members values and operations.
Object databases are different from relational databases which are table-oriented.
Traditional File-based Approach
The term 'file-based approach' refers to the situation where data is stored in one or more separate
computer files defined and managed by different application programs. Typically, for example,
the details of customers may be stored in one file, orders in another, etc. Computer programs
access the stored files to perform the various tasks required by the business. Each program, or
sometimes a related set of programs, is called a computer application. For example, all of the
programs associated with processing customers' orders are referred to as the order processing
application. The file-based approach might have application programs that deal with purchase
orders, invoices, sales and marketing, suppliers, customers, employees, and so on.
The following diagram shows how different applications will each have their own copy of
the files they need in order to carry out the activities for which they are responsible:
Drawbacks of File system
Data redundancy: Data redundancy refers to the duplication of data, lets say we are
managing the data of a college where a student is enrolled for two courses, the same
student details in such case will be stored twice, which will take more storage than
needed. Data redundancy often leads to higher storage costs and poor access time.
Data inconsistency: Data redundancy leads to data inconsistency, lets take the same
example that we have taken above, a student is enrolled for two courses and we have
student address stored twice, now lets say student requests to change his address, if the
address is changed at one place and not on all the records then this can lead to data
inconsistency.
Data Isolation: Because data are scattered in various files, and files may be in different
formats, writing new application programs to retrieve the appropriate data is difficult.
Dependency on application programs: Changing files would lead to change in
application programs.
Atomicity issues: Atomicity of a transaction refers to “All or nothing”, which means
either all the operations in a transaction executes or none.
For example: Lets say Steve transfers Ksh 1000 to Sharon’s account. This transaction
consists multiple operations such as debit Ksh 1000 from Steve’s account, credit Ksh
1000 to Sharon’s account. Like any other device, a computer system can fail lets say it
fails after first operation then in that case Steve’s account would have been debited by
Ksh 1000 but the amount was not credited to Sharon’s account, in such case the rollback
of operation should occur to maintain the atomicity of transaction. It is difficult to
achieve atomicity in file processing systems.
Data Security: Data should be secured from unauthorised access, for example a student
in a college should not be able to see the payroll details of the teachers, such kind of
security constraints are difficult to apply in file processing systems.
Advantage of DBMS over File System
There are several advantages of Database management system over file system. Few of them are
as follows:
Disadvantages of DBMS:
Only one user can access data at a Multiple users can access data
User Access
time. at a time.
Components of DBMS
Hardware, Software, Data, Database Access Language, Procedures and Users all together form
the components of a DBMS.
Hardware - The hardware is the actual computer system used for keeping and accessing
the database. The conventional DBMS hardware consists of secondary storage devices
such as hard disks. Databases run on the range of machines from micro computers to
mainframes.
Software - Software is the actual DBMS between the physical database and the users of
the system. All the requests from the user for accessing the database are handled by
DBMS.
Data - Data is the information that is managed by DBMS. The main task of DBMS is to
process the data. Databases are used to store the data, retrieved, and updated to and from
the databases.
Database Access Language – The language that is used to write commands on the
DBMS to access, utilize, manage, update and delete data, is called the Database Access
Language. Commands are written using the Database Access Language and submitted to
the DBMS so they can be executed by the DBMS.
Procedures – All the instructions that are given to access the DBMS, fall under
Procedures. From installing DBMS, to generating reports, all of these instructions are a
part of the procedures involved in DBMS.
Users - People who can access the database for querying, updating, and generating
reports.
Application of DBMS
Sector Application
The end users are the people who interact with the database
End-Users management system. They conduct various operations on
database like retrieving, updating, deleting, etc.
Despite the earlier mentioned disadvantages, a DBMS system is still useful. However, the initial
investment required to build a DBMS infrastructure is quite high. Therefore, it is not ideal to use
DBMS for small projects where an organization cannot afford the hardware and training costs.
But, this is only when we are setting up our own database servers. Cloud databases are cheap and
come in handy, and anybody can use them.