DBMS - Module 1
DBMS - Module 1
Introduction
Database management System or DBMS is a combination of two words - Database + Management System. A
database is a collection of related information which is stored to be available to many users for different
purposes. Overall DBMS is a collection of interrelated data and a set of programs to access the data. It is
used to organize the data in the form of a table, schema, form or report etc. The primary goal of DBMS is to
provide a convenient and efficient way to store and retrieve database information.
B
HU
DBMS can also be defined as an interface between the application program and the operating system, used to
access and manipulate databases. Some examples of database softwares are: MYSQL, Oracle. These are very
popular commercial databases.
Characteristics of DBMS
The characteristics of DBMS are mentioned below:
●
●
●
●
ER
It uses a digital repository established on a server to store and manage the information.
It can provide a clear and logical view of the process that how the data is manipulated.
DBMS contains automatic backup and recovery procedures.
It follows the ACID [Atomicity, Consistency, Isolation, Durability] properties which are necessary to
RE
maintain the data in a healthy state.
● It can reduce the complex relationship between the data.
● It is used to support manipulation and processing of data.
● It is used to provide security of data.
● It can be used to view the database from different viewpoints according to the requirements of the
CA
user.
Application of DBMS
The application of DBMS are mentioned below:
1. Banking: For maintaining customer information, accounts, loans, and banking transactions.
2. Universities: For maintaining student records, course registration and grades.
H
3. Railway Reservation: For checking the availability of reservation in different trains, tickets etc.
4. Airlines: for reservation of flights and checking schedule information.
UT
5. Telecommunication: for keeping records of calls made, generating monthly bills etc.
6. Finance: for storing information about holidays, sales, and purchase of financial instruments.
7. Sales: for storing customer, product and purchase information.
Advantages of DBMS
YO
● Control database redundancy: It can control data redundancy because it stores all related data in
one database in an efficient way.
● Data sharing: In DBMS, the authorized users of an organization can share the data among multiple
users.
● Easy maintenance: It can be easily maintained due to the centralized nature of the database
system.
● Reduces time: It reduces development and maintenance time.
● Backup: It provides backup and recovery systems which create automatic backup of data from
hardware and software failure and restores the data if required.
● Multiple user interface: It provides different types of user interface like graphical user interface,
application program interface.
Disadvantages of DBMS
● Cost of hardware and software: It requires a high speed data processor and memory to run DBMS
software.
● Size: It occupies large space in the disks and requires large main memory to run them efficiently.
● Complexity: Database system creates additional complexity and requirements.
● Higher impact of failure: Failure highly impacts the database system because in most of the
organizations all the data is stored in a single database and if the database is damaged due to
electrical failure or database corruption then the data may be lost forever.
Types of Databases
There are various types of databases used for storing different varieties of data.
B
HU
Centralized Database ER
It’s a type of database that stores data at a central database. It enables users to access the stored data from
different locations through several applications. These applications contain the authentication process to let
RE
users access data efficiently. For example — A central library that carried a central database of each library in
a college/university.
Distributed Database
CA
In a distributed database, 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. It is divided into two types.
H
UT
Relational Database
It stores the data in the form of rows and columns, and together they form a table. A relational database
uses SQL for storing, manipulating, as well as maintaining the data. Each table in the database carries a key
that makes the data unique. Examples of relational databases are — MYSQL, Microsoft SQL Server, Oracle
YO
etc.
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 also in several other ways. It is divided into
four subparts:
1) Key-value storage
2) Document-oriented database
3) Graph database
4) Wide-Column store
Cloud Database
It is a type of database where data is stored in a virtual environment and this environment is executed in the
cloud computing platform. It provides users various cloud computing services (SaaS,PaaS,IaaS etc.) for
database access. Examples of cloud databases are — Amazon Web Services (AWS), Microsoft Azure, Google
Cloud SQL etc.
Object-Oriented Database
It is a type of database that uses the object based data model for storing the data in the database system.
The data is represented as objects which are similar to the objects used in object oriented programming.
Hierarchical Database
It is a type of database that stores data in the form of a parent-children relationship node. It organizes data
B
in a tree-like structure. Example —
HU
ER
Data gets stored in the form of records that are connected via links. Each child record in the tree will contain
only one parent. On the other hand, each parent record can have multiple child records.
RE
Network Database
It is a type of database that typically follows the network. This representation of data is in the form of nodes
connected via links between them. It allours each record to have multiple Children and parent nades to form
a generalized graph structure.
CA
H
UT
RDBMS
YO
RDBMS stands for Relational Database Management System. It is based on the relational model as introduced
by Dr. E. F. Codd. RDBMS Stores data in the form of related tables. An Important feature of relational
Systems is that a single database Can be spread across several tables. All modern database management
System. like SQL, MS SQL Server, IBM DB2, ORACLE, MYSQL and Microsoft Access are based on RDBMS. A
relational database is the most commonly used database. It contains several tables. and each table has its
primary key. Due to a collection of an organized table, data can be accessed easily in RDBMS. Everything in a
relational database is stored in the form of relations. Example —
B
Table/ Relation
Everything in a relational database is stored in the form of relations. RDBMS uses tables to store data. A
HU
table is a collection of related data entries and contains rows and columns to store data.
Row or record
RE
A row of a table is also called a record or tuple. Row Contains the specific information of each entry in the
table. It is the horizontal entity in the table.
Properties of a Row:
CA
Column/Attribute/Field
A Column is a vertital entity in the table which contains all information associated with a specific field in a
H
table.
UT
Properties of an Attributes:
● Attribute that uniquely identifies each tuple of a relation is the primary key.
Other Definitions
Data item/cells: The smallest unit of data in the table is an individual data item. It is stored at the
intersection of tuples and attributes
Degree: The total number of attributes that comprise a relation is known as the degree of the table.
Cardinality: The total number of tuples at any one time in a relation is known as the table's Cardinality. The
relation which has a cardinality of zeго is called an Empty table.
Domain: The domain refers to the possible values each attribute can contain. It can be specified using
standard data types such as integers, floating numbers etc.
Dr. EF Codd's Rules for RDBMS
Dr. EF Codd is an IBM researcher who developed the first relational data model in 1970. In 1985, Dr. Codd
published a list of 12 Rules that define an ideal relational database and has provided a guideline for the
design of all relational database systems.
Rule 1> The Information Rule: This rule simply requires that all data should be presented in table form.
This is the basis of relational models.
Rule 2> Guaranteed Access Rule: Every single data element (value) should be guaranteed to be
accessible logically with a combination of Table-name, Primary Key (row value) and Attribute-name (column
value).
Rule 3> Systematic Treatment of Null Value: The NULL values in a database must be given a systematic
B
and uniform treatment. This is a very important rule because a NULL can be interpreted as one of the
following — i) Data is missing, ii) Data is not known iii) Data is not applicable.
HU
Rule 4> Active Online Catalogue: The structure description of the entire database must be stored in an
online catalogue known as data dictionary which can be accessed by authorized users. Users can use the
same query language to access the catalogue which they use to access the database itself.
Rule 5> Comprehensive Data Sublanguage Rule: A database can only be accessed using a language
having linear syntax that supports data definition, data manipulation anal transaction management
operations. All commercial relational databases use forms of SQL as their supported language.
ER
Rule 6> View Updating Rule: Data can be presented in different logical combinations called views. Each
view should support the same full range of data manipulation that has direct access to a table available.
Rule 7> High Level Insert, Update and Delete: A database must support high-Level insertion, updation,
RE
and deletion. This must not be limited to a single row, that is, it must also support union, intersection and
mines operations to yield sets of data records.
Rule 8> Physical Data Independence: The data stored in a database must be independent of the
applications that access the database. Any change in the physical structure of the database must not have
CA
Rule 9> Logical Data Independence: The logical data in a database must be independent of its user's
view (Applitation). Any change in logical data must not affect the applications using it.
Rule 10> Integrity Independence: The database language (like SQL) should support constraints on user
maintain database integrity. No component of a primary key can have a NULL value. If a foreign key is
H
defined in one table, any value in it must exist as a primary key in another table
UT
Rule 11> Distribution Independence: The end user must not be able to see that the data is distributed
over various locations. Users should always get the impression that the data is Located of one site Only This
rule has been marked as the foundation of distributed database System
Rule 12> Non-Subversion Rule: There should be no way to modify the database structure other than
YO
through the multiple row database language. Most databases today support administrative tools that allows
direct manipulation of the data structure.
Difference Between DBMS and RDBMS
DBMS RDBMS
In DBMS, relationships between two tables or files In RDBMS, relationships between two tables or files
are maintained programmatically. can be specified at the time of table creation.
DBMS applications stores data as files RDBMS applications stores data in tabular form
DBMS does not support client/server architecture RDBMS supports client/server architecture
DBMS does not apply any scrutiny with regards to RDBMS defines the integrity constraints for the
data manipulation. purpose of ACID (Atomicity, Consistency, Isolation
and Durability)
B
DBMS uses a file system to store data, so there will In RDBMS, data values are stored in the form of
be no relation between the tables. tables, so a relationship between these data values
HU
will be stored in the form of tables.
DBMS does not support distributed databases. RDBMS supports distributed databases.
DBMS is meant to be used in small organisations RDBMS is designed to handle large amounts of data.
and deal with small data. It supports single user It supports multiple users.
DBMS may satisfy less than 7 to 8 rules of E.F. Codd RDBMS supports all 12 rules of E.F. Codd
ER
Example of DBMS — file system, XML etc. Example of RDBMS — MYSQL,Oracle, PostgreSQL
In DBMS, the user is not required to write the In this, the user has to write the procedures to
CA
In DBMS, due to centralized approach. Data sharing In the file system data is decentralized in many files
is easy. and it may be of different format so it is not easy to
store data.
DBMS gives an abstract view of data that hides the The file system gives the details of data
details. representation and storage
H
In DBMS there is no data redundancy problem In file system there is data redundancy problem
UT
In DBMS, data inconsistency does not exist. In file system there is data inconsistency
In DBMS, Data independence two types of exist — In the file system there is no data independence.
Logical and Physical
Integrity constraints are easy to apply. Integrity constraints are difficult to apply.
The database approach has 3 different data models In the file system there is no concept of data model.
— Hierarchical, Network, Relational.
Database architecture can be seen as a single tier or multi tier but logically. Database Architecture is of three
types — 1-tier Architecture , 2-tier Architecture and 3-tier Architecture.
1-Tier Architecture: In this architecture, the database is directly available to the user. It means the user
can directly be on the DBMS and use it. Any changes done here will directly be done on the database itself. It
doesn't provide a handy tool for end users. The 1-tier architecture is used for development of the Local
B
Application, where programmers can directly Communicate with the database for quick response.
HU
2-Tier Architecture: The 2-Tier architecture is
the 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. The user Interfaces and
application programs are run on the client-side.
ER
The server side is responsible for provable
functionality: query processing and transaction
processing.
Overall design of the database is called the database schema. Three schema architecture is also called
ANSI/SPARC (American National Standards Institute / Standards Planning and requirements committee )
UT
architecture or three level architecture. Three schema architecture is also used to separate the user
applications and the physical database.
YO
Levels of Schema
Internal Level
The internal level has an internal schema which describes the physical storage of the database.
The internal schema is also known as a physical schema. It uses the physical data model. It is used to define
how the data will be stored in a block. The Physical level is used to describe complex low-level data structure
B
in detail.
HU
Conceptual Level
The conceptual schema describes the design of a database at the conceptual level. Conceptual level is also
known as logical level. The conceptual schema describes the structure of the whole database.
Employee
External Level
CA
At the external level a database contains several schemas that are sometimes called subschemas. The
Subschema is used to describe different views of the database.
Each view schema describes the database part that a particular user group is interested in and hides the
remaining database from that user group. The view schema describes the end user interaction with database
H
systems.
UT
Data Independence
The ability to modify a schema definition in one level without affecting a schema definition in the next higher
level is called data independence. Data independence is one of the main advantages of DBMS. Data
independence has two types — Physical Data Independence and Logical Data Independence.
YO
Physical Data Independence
Physical Data independence can be defined as the capacity to change the internal Schema without having to
change the conceptual schema. 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. It is the ability to modify the physical Schema
without causing application programs to be rewritten. Physical Data Independence is used to separate
conceptual Levels from the internal levels. It occurs at the Logical Interface Levels.
B
Data Models
HU
Data model is the modeling of the data description, data Semantics, and Consistency Constraints of the data.
Data model provides the conceptual tools for describing the design of a database at each level of data
abstraction. A Data model can also be defined as the collection of high-level data descriptions and constructs
that hide many low level storage details. There are mainly three types of Data models —
ER
RE
CA
a) Entity Relationship model: An ER model is the Logical representation of data as objects and
UT
relationships among them. These objects are known as Entities and Relationship is an association among
these Entities.
YO
b) Object-oriented Data model: In object-oriented model information or data is displayed as an object and
these objects store the value in the instance variable. In this model programming images are used. This
model works with object oriented programming languages like — Python, Java, VB.Net, Perl etc. It was
introduced in the 1980s.
Record Based Data Model
It is used to describe data at logical and view level. This data model is used to specify the overall logical
structure and the higher level structure and provide higher level description. There are three types of record
based data model.
a) Relational Data Model: This type of model designs the data in the form of rows and columns within a
table. Each table has multiple columns and each column has a unique name. This model was initially
described by Edgar F Codd in 1969. This model uses the certain mathematical operations from relational
algebra and relational calculus on the relation such as union, join etc.
01 Kailash Haridwar
B
02 Kamal Dehradun
03 Tina Delhi
HU
04 Rahul Mumbai
ER
modelling of many to many relationships in data.
DBMS Interface
H
A Database management system interface is a user interface that allows for the ability to input queries to a
database without using the query language itself. The interfaces provided by DBMS are of the following types.
UT
1) Menu-Based Interfaces for Web Clients or Browsing: These interfaces present the user with lists of
opticons (menus) that lead the user through the formation of the request. Basic advantage of using menus is
that they removes the tension of remembering specific commands and syntax of any query Language
YO
2) Form-Based Interfaces: A form-based interface displays a form to each user. Users Can fill out all of the
form entries to insert new data, or they can fill out only certain entries, in which case the DBMS will retrieve
matching data for the remaining entries. Many DBMS use special languages that help programmers specify
such forms.
3) Graphical User Interfaces: A Graphical User Interface (GUI) typically displays a schema to the user in
diagrammatic form. The user can specify a query by manipulating the diagram In many cases, GUIs utilize
both menus and forms. Most GUIs require a pointing device such as mouse, to pick a certain part of the
displayed schema diagram.
4) Natural Language Interfaces: These interfaces accept requests written in English or some other
language and attempt to understand them. A natural language interface usually has its own schema which is
similar to the database conceptual schema.
5) Interface for Parametric Users: Parametric users such as bank tellers, often have a small set of
operations that they must perform repeatedly system analyst and programmers design and implement a
special interface for a known Class of naive users.
6) Interface for the DBA: Most database systems contain privileged commands that can be used only by
the DBA'S Staff. These include commands for creating, accounts, setting system parameters etc.
B
HU
ER
RE
CA
H
UT
YO