Professional Documents
Culture Documents
Database Management System: (BCAC-401)
Database Management System: (BCAC-401)
(BCAC-401)
pg. 1
Purpose Of Database Management System
The Database Management System (DBMS) is defined as a software system that allows the
user to define, create and maintain the database and provide control access to the data.
It is a collection of programs used for managing data and simultaneously it supports different
types of users to create, manage, retrieve, update and store information.
Purpose
The purpose of DBMS is to transform the following −
Data into information.
Information into knowledge.
Knowledge to the action.
The diagram given below explains the process as to how the transformation of data to
information to knowledge to action happens respectively in the DBMS −
Previously, the database applications were built directly on top of the file system.
Drawbacks in File System
There are so many drawbacks in using the file system. These are mentioned below −
Data redundancy and inconsistency: Different file formats, duplication of
information in different files.
pg. 2
Difficulty in accessing data: To carry out new task we need to write a new
program.
Data Isolation − Different files and formats.
Integrity problems.
Atomicity of updates − Failures leave the database in an inconsistent state. For
example, the fund transfer from one account to another may be incomplete.
Concurrent access by multiple users.
Security problems.
Database system offer so many solutions to all these problems
Uses of DBMS
The main uses of DBMS are as follows −
Data independence and efficient access of data.
Application Development time reduces.
Security and data integrity.
Uniform data administration.
Concurrent access and recovery from crashes.
Applications of DBMS
The different applications of DBMS are as follows −
Railway Reservation System − It is used to keep record of booking of tickets,
departure of the train and the status of arrival and give updates to the
passengers with the help of a database.
Library Management System − There will be so many numbers of books in
the library and it is very hard to keep a record of all the books in a register or a
copy. So, DBMS is necessary to keep track of all the book records, issue dates,
name of the books, author and maintain the records.
Banking − We are doing a lot of transactions daily without directly going to
the banks. The only reason is the usage of databases and it manages all the data
of the customers over the database.
Educational Institutions − All the examinations and the data related to the
students maintained over the internet with the help of a database management
system. It contains registration details of the student, results, grades and
courses available. All these works can be done online without visiting an
institution.
Social Media Websites − By filling the required details we are able to access
social media platforms. Many users daily sign up for social websites such as
Facebook, Pinterest and Instagram. All the information related to the users are
stored and maintained with the help of DBMS.
View of data in DBMS narrate how the data is visualized at each level of
data abstraction? Data abstraction allow developers to keep complex data
pg. 3
structures away from the users. The developers achieve this by hiding the
complex data structures through levels of abstraction.
There is one more feature that should be kept in mind i.e. the data
independence. While changing the data schema at one level of the database
must not modify the data schema at the next level. In this section, we will
discuss the view of data in DBMS with data abstraction, data independence,
data schema in detail.
Data Abstraction
Data abstraction is hiding the complex data structure in order to simplify
the user’s interface of the system. It is done because many of the users
interacting with the database system are not that much computer trained to
understand the complex data structures of the database system.
Three-Schema Architecture:
The main objective of this architecture is to have an effective separation
between the user interface and the physical database. So, the user never
has to be concerned regarding the internal storage of the database and it
has a simplified interaction with the database system.
The physical or the internal level schema describes how the data is stored in
the hardware. It also describes how the data can be accessed. The physical
pg. 4
level shows the data abstraction at the lowest level and it has complex data
structures. Only the database administrator operates at this level.
It is a level above the physical level. Here, the data is stored in the form of
the entity set, entities, their data types, the relationship among the entity
sets, user operations performed to retrieve or modify the data and
certain constraints on the data. Well adding constraints to the view of data
adds the security. As users are restricted to access some particular parts of
the database.
It is the highest level of data abstraction and exhibits only a part of the
whole database. It exhibits the data in which the user is interested. The
view level can describe many views of the same data. Here, the user
retrieves the information using different application from the database.
pg. 5
In the figure above you can clearly distinguish between the three levels of
abstraction. To understand it more clearly let us take an example:
Now, the entity sets Student, Lecturer, Department, Course will be stored in
the storage as the consecutive blocks of the memory location. This is
the physical or internal level and is hidden from the programmers but the
database administrator is it aware of it.
pg. 6
At the view level, the users have the set of applications which they use to
retrieve the data they are interested in.
Data Independence
Data independence defines the extent to which the data schema can be
changed at one level without modifying the data schema at the next level.
Data independence can be classified as shown below:
Well, the changes to data schema at the logical level are made either
to enlarge or reduce the database by adding or deleting more entities,
entity sets, or changing the constraints on data.
pg. 7
Now, at a particular time if we retrieve any information from the database
then that corresponds to an instance.
What is schema?
Whenever we talk about the database the developers have to deal with the
definition of database and the data in the database.
Key Takeaways:
View of data in DBMS describes the abstraction of data at three-level
i.e. physical level, logical level, view level.
The physical level of abstraction defines how data is stored in the
storage and also reveals its access path.
Abstraction at the logical level describes what data would be stored in
the database? what would be the relation between the data? and
the constraints applied to the data.
The view level or external level of abstraction describes
the application which the users use to retrieve the information from
the database.
Data independence explains the extent to which data at a certain
level can be modified without disturbing the data next higher levels.
An instance is the retrieval of information from the database at a
certain point of time. An instance in a database keeps on changing
with time.
Schema is the overall design of the entire database. Schema of the
database is not changed frequently.
So that’s all about the view of data in the database which help us to
understand the database from users, developers and database administrator
aspects.
pg. 8
Data model
o The data which is stored in the database at a particular moment of time is
called an instance of the database.
o The overall design of a database is called schema.
o A database schema is the skeleton structure of the database. It represents the
logical view of the entire database.
o A schema contains schema objects like table, foreign key, primary key, views,
columns, data types, stored procedure, etc.
o A database schema can be represented by using the visual diagram. That
diagram shows the database objects and relationship with each other.
o A database schema is designed by the database designers to help
programmers whose software will interact with the database. The process of
database creation is called data modeling.
A schema diagram can display only some aspects of a schema like the name of
record type, data type, and constraints. Other aspects can't be specified through the
schema diagram. For example, the given figure neither show the data type of each
data item nor the relationship among various files.
In the database, actual data changes quite frequently. For example, in the given
figure, the database changes whenever we add a new grade or add a student. The
data at a particular moment of time is called the instance of the database.
pg. 9
ER (Entity Relationship) Diagram in DBMS
o ER model stands for an Entity-Relationship model. It is a high-level data model. This
model is used to define the data elements and relationship for a specified system.
o It develops a conceptual design for the database. It also develops a very simple and
easy to design view of data.
o In ER modeling, the database structure is portrayed as a diagram called an entity-
relationship diagram.
pg. 10
Component of ER Diagram
1. Entity:
An entity may be any object, class, person or place. In the ER diagram, an entity can
be represented as rectangles.
a. Weak Entity
pg. 11
An entity that depends on another entity called a weak entity. The weak entity
doesn't contain any key attribute of its own. The weak entity is represented by a
double rectangle.
2. Attribute
The attribute is used to describe the property of an entity. Eclipse is used to
represent an attribute.
For example, id, age, contact number, name, etc. can be attributes of a student.
a. Key Attribute
pg. 12
b. Composite Attribute
c. Multivalued Attribute
An attribute can have more than one value. These attributes are known as a
multivalued attribute. The double oval is used to represent multivalued attribute.
For example, a student can have more than one phone number.
pg. 13
d. Derived Attribute
An attribute that can be derived from other attribute is known as a derived attribute.
It can be represented by a dashed ellipse.
For example, A person's age changes over time and can be derived from another
attribute like Date of birth.
3. Relationship
A relationship is used to describe the relation between entities. Diamond or rhombus
is used to represent the relationship.
pg. 14
Types of relationship are as follows:
a. One-to-One Relationship
When only one instance of an entity is associated with the relationship, then it is
known as one to one relationship.
For example, A female can marry to one male, and a male can marry to one female.
b. One-to-many relationship
When only one instance of the entity on the left, and more than one instance of an
entity on the right associates with the relationship then this is known as a one-to-
many relationship.
For example, Scientist can invent many inventions, but the invention is done by the
only specific scientist.
pg. 15
c. Many-to-one relationship
When more than one instance of the entity on the left, and only one instance of an
entity on the right associates with the relationship then it is known as a many-to-one
relationship.
For example, Student enrolls for only one course, but a course can have many
students.
d. Many-to-many relationship
When more than one instance of the entity on the left, and more than one instance
of an entity on the right associates with the relationship then it is known as a many-
to-many relationship.
For example, Employee can assign by many projects and project can have many
employees.
pg. 16