0% found this document useful (0 votes)
40 views20 pages

Intro To DBMS

Uploaded by

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

Intro To DBMS

Uploaded by

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

DBMS: DBMS stands for Database Management System.

Database is a
collection of data and Management System is a set of programs to store and
retrieve those data. Based on this we can define DBMS like this: DBMS is a
collection of inter-related data and set of programs to store & access those data
in an easy and effective manner.

Advantage of DBMS over fle system


There are several advantages of Database management system over file
system. Few of them are as follows:

 No redundant data: Redundancy removed by data normalization. No data


duplication saves storage and improves access time.
 Data Consistency and Integrity: As we discussed earlier the root cause
of data inconsistency is data redundancy, since data normalization takes
care of the data redundancy, data inconsistency also been taken care of as
part of it
 Data Security: It is easier to apply access constraints in database systems
so that only authorized user is able to access the data. Each user has a
different set of access thus data is secured from the issues such as identity
theft, data leaks and misuse of data.
 Privacy: Limited access means privacy of data.
 Easy access to data – Database systems manages data in such a way so
that the data is easily accessible with fast response times.
 Easy recovery: Since database systems keeps the backup of data, it is
easier to do a full recovery of data in case of a failure.
 Flexible: Database systems are more flexible than file processing
systems.

Disadvantages of DBMS:

 DBMS implementation cost is high compared to the file system


 Complexity: Database systems are complex to understand
 Performance: Database systems are generic, making them suitable for
various applications. However this feature affect their performance for some
applications

Database Applications – DBMS


Applications where we use Database Management Systems are:
 Telecom: There is a database to keeps track of the information regarding
calls made, network usage, customer details etc. Without the database
systems it is hard to maintain that huge amount of data that keeps updating
every millisecond.
 Industry: Where it is a manufacturing unit, warehouse or distribution
centre, each one needs a database to keep the records of ins and outs. For
example distribution centre should keep a track of the product units that
supplied into the centre as well as the products that got delivered out from
the distribution centre on each day; this is where DBMS comes into picture.
 Banking System: For storing customer info, tracking day to day credit and
debit transactions, generating bank statements etc. All this work has been
done with the help of Database management systems.
 Sales: To store customer information, production information and invoice
details.
 Airlines: To travel though airlines, we make early reservations, this
reservation information along with flight schedule is stored in database.
 Education sector: Database systems are frequently used in schools and
colleges to store and retrieve the data regarding student details, staff
details, course details, exam details, payroll data, attendance details, fees
details etc. There is a hell lot amount of inter-related data that needs to be
stored and retrieved in an efficient manner.
 Online shopping: You must be aware of the online shopping websites
such as Amazon, Flipkart etc. These sites store the product information,
your addresses and preferences, credit details and provide you the relevant
list of products based on your query. All this involves a Database
management system.

DBMS Architecture
The architecture of DBMS depends on the computer system on which it runs. For
example, in a client-server DBMS architecture, the database systems at server
machine can run several requests made by client machine. We will understand
this communication with the help of diagrams.

Types of DBMS Architecture


There are three types of DBMS architecture:

1. Single tier architecture


2. Two tier architecture
3. Three tier architecture
1. Single tier architecture
In this type of architecture, the database is readily available on the client
machine, any request made by client doesn’t require a network connection to
perform the action on the database.

For example, lets say you want to fetch the records of employee from the
database and the database is available on your computer system, so the request
to fetch employee details will be done by your computer and the records will be
fetched from the database by your computer as well. This type of system is
generally referred as local database system.
2. Two tier architecture

[Grab your reader’s ateenoe n th a


great quote from the documeet or use
th s space to emphas ze a key po et.
To place th s text box aeynhere oe
the page, just drag t.]
In two-tier architecture, the Database system is present at the server machine
and the DBMS application is present at the client machine, these two machines
are connected with each other through a reliable network as shown in the above
diagram.

Whenever client machine makes a request to access the database present at


server using a query language like sql, the server perform the request on the
database and returns the result back to the client. The application connection
interface such as JDBC, ODBC are used for the interaction between server and
client.

3. Three tier architecture

In three-tier architecture, another layer is present between the client machine and
server machine. In this architecture, the client application doesn’t communicate
directly with the database systems present at the server machine, rather the
client application communicates with server application and the server
application internally communicates with the database system present at the
server.

DBMS Three Level Architecture Diagram

This architecture has three levels:


1. External level
2. Conceptual level
3. Internal level
1. External level
It is also called view level. The reason this level is called “view” is because
several users can view their desired data from this level which is internally
fetched from database with the help of conceptual and internal level mapping.

The user doesn’t need to know the database schema details such as data
structure, table definition etc. user is only concerned about data which is what
returned back to the view level after it has been fetched from database (present
at the internal level).

External level is the “top level” of the Three Level DBMS Architecture.

2. Conceptual level
It is also called logical level. The whole design of the database such as
relationship among data, schema of data etc. are described in this level.

Database constraints and security are also implemented in this level of


architecture. This level is maintained by DBA (database administrator).

3. Internal level
This level is also known as physical level. This level describes how the data is
actually stored in the storage devices. This level is also responsible for allocating
space to the data. This is the lowest level of the architecture.

Data Abstraction in DBMS


Database systems are made-up of complex data structures. To ease the user
interaction with database, the developers hide internal irrelevant details from
users. This process of hiding irrelevant details from user is called data
abstraction.
We have three levels of abstraction:
Physical level: This is the lowest level of data abstraction. It describes how data
is actually stored in database. You can get the complex data structure details at
this level.

Logical level: This is the middle level of 3-level data abstraction architecture. It
describes what data is stored in database.

View level: Highest level of data abstraction. This level describes the user
interaction with database system.

Example: Let’s say we are storing customer information in a customer table.


At physical level these records can be described as blocks of storage (bytes,
gigabytes, terabytes etc.) in memory. These details are often hidden from the
programmers.
At the logical level these records can be described as fields and attributes along
with their data types, their relationship among each other can be logically
implemented. The programmers generally work at this level because they are
aware of such things about database systems.

At view level, user just interact with system with the help of GUI and enter the
details at the screen, they are not aware of how the data is stored and what data
is stored; such details are hidden from them.

Data models in DBMS


Data Model is a logical structure of Database. It describes the design of
database to reflect entities, attributes, relationship among data, constrains etc.

Types of Data Models


There are several types of data models in DBMS. We will cover them in detail in
separate articles(Links to those separate tutorials are already provided below). In
this guide, we will just see a basic overview of types of models.

Object based logical Models – Describe data at the conceptual and view levels.

1. E-R Model
2. Object oriented Model

Record based logical Models – Like Object based model, they also describe
data at the conceptual and view levels. These models specify logical structure of
database with records, fields and attributes.

1. Relational Model
2. Hierarchical Model
3. Network Model – Network Model is same as hierarchical model except that
it has graph-like structure rather than a tree-based structure. Unlike
hierarchical model, this model allows each record to have more than one
parent record.

Physical Data Models – These models describe data at the lowest level of
abstraction.
Entity Relationship Diagram – ER Diagram in
DBMS
An Entity–relationship model (ER model) describes the structure of a
database with the help of a diagram, which is known as Entity Relationship
Diagram (ER Diagram). An ER model is a design or blueprint of a database that
can later be implemented as a database. The main components of E-R model
are: entity set and relationship set.

What is an Entity Relationship Diagram (ER


Diagram)?
An ER diagram shows the relationship among entity sets. An entity set is a group
of similar entities and these entities can have attributes. In terms of DBMS, an
entity is a table or attribute of a table in database, so by showing relationship
among tables and their attributes, ER diagram shows the complete logical
structure of a database. Lets have a look at a simple ER diagram to understand
this concept.

A simple ER Diagram:
In the following diagram we have two entities Student and College and their
relationship. The relationship between Student and College is many to one as a
college can have many students however a student cannot study in multiple
colleges at the same time. Student entity has attributes such as Stu_Id,
Stu_Name & Stu_Addr and College entity has attributes such as Col_ID &
Col_Name.

Here are the geometric shapes and their meaning in an E-R Diagram. We will
discuss these terms in detail in the next section(Components of a ER Diagram)
of this guide so don’t worry too much about these terms now, just go through
them once.

Rectangle: Represents Entity sets.


Ellipses: Attributes
Diamonds: Relationship Set
Lines: They link attributes to Entity Sets and Entity sets to Relationship Set
Double Ellipses: Multivalued Attributes
Dashed Ellipses: Derived Attributes
Double Rectangles: Weak Entity Sets
Double Lines: Total participation of an entity in a relationship set
Components of a ER Diagram

As shown in the above diagram, an ER diagram has three main components:


1. Entity
2. Attribute
3. Relationship

1. Entity
An entity is an object or component of data. An entity is represented as rectangle
in an ER diagram.

For example: In the following ER diagram we have two entities Student and
College and these two entities have many to one relationship as many students
study in a single college. We will read more about relationships later, for now
focus on entities.

Weak Entity:
An entity that cannot be uniquely identified by its own attributes and relies on the
relationship with other entity is called weak entity. The weak entity is represented
by a double rectangle. For example – a bank account cannot be uniquely
identified without knowing the bank to which the account belongs, so bank
account is a weak entity.

2. Attribute
An attribute describes the property of an entity. An attribute is as Oval in an ER
diagram. There are four types of attributes:

1. Key attribute
2. Composite attribute
3. Multivalued attribute
4. Derived attribute

1. Key attribute:
A key attribute can uniquely identify an entity from an entity set. For example,
student roll number can uniquely identify a student from a set of students. Key
attribute is represented by oval same as other attributes however the text of key
attribute is underlined.

2. Composite attribute:
An attribute that is a combination of other attributes is known as composite
attribute. For example, In student entity, the student address is a composite
attribute as an address is composed of other attributes such as pin code, state,
country.
3. Multivalued attribute:
An attribute that can hold multiple values is known as multivalued attribute. It is
represented with double ovals in an ER Diagram. For example – A person can
have more than one phone numbers so the phone number attribute is
multivalued.

4. Derived attribute:
A derived attribute is one whose value is dynamic and derived from another
attribute. It is represented by dashed oval in an ER Diagram. For example –
Person age is a derived attribute as it changes over time and can be derived
from another attribute (Date of birth).

E-R diagram with multivalued and derived attributes:

Object based databases

 Object oriented database systems are alternative to relational database


and other database systems.

 In object oriented database, information is represented in the form of


objects.

 Object oriented databases are exactly same as object oriented


programming languages. If we can combine the features of relational model
(transaction, concurrency, recovery) to object oriented databases, the resultant
model is called as object oriented database model.
Features of OODBMS
In OODBMS, every entity is considered as object and represented in a table.
Similar objects are classifed to classes and subclasses and relationship between
two object is maintained using concept of inverse reference.

Some of the features of OODBMS are as follows:

1. Complexity
OODBMS has the ability to represent the complex internal structure (of object)
with multilevel complexity.

2. Inheritance
Creating a new object from an existing object in such a way that new object
inherits all characteristics of an existing object.

3. Encapsulation
It is an data hiding concept in OOPL which binds the data and functions together
which can manipulate data and not visible to outside world.

4. Persistency
OODBMS allows to create persistent object (Object remains in memory even
after execution). This feature can automatically solve the problem of recovery
and concurrency.
Relational model in DBMS
In relational model, the data and relationships are represented by collection of
inter-related tables. Each table is a group of column and rows, where column
represents attribute of an entity and rows represents records.

Sample relationship Model: Student table with 3 columns and four records.

Table: Student

Stu_Id Stu_Name Stu_Age

111 Ash sh 23

123 Saurav 22

169 Lester 24

234 Lou 26

Table: Course

Stu_Id Course_Id Course_Name

111 C01 Sc eece

111 C02 DBMS

169 C22 Java

169 C39 Computer Netnorks


Here Stu_Id, Stu_Name & Stu_Age are attributes of table Student and Stu_Id,
Course_Id & Course_Name are attributes of table Course. The rows with values
are the records (commonly known as tuples).

Hierarchical model in DBMS


In hierarchical model, data is organized into a tree like structure with each
record is having one parent record and many children. The main drawback of this
model is that, it can have only one to many relationships between nodes.

Note: Hierarchical models are rarely used now.

Sample Hierarchical Model Diagram:


Lets say we have few students and few courses and a course can be assigned to
a single student only, however a student take any number of courses so this
relationship becomes one to many.

Example of hierarchical data represented as relational tables: The above


hierarchical model can be represented as relational tables like this:

Stu_Id Stu_Name Stu_Age


123 Steve 29

367 Cha taeya 27

234 Ajeet 28

Course Table:

Course_Id Course_Name Stu_Id

C01 Cobol 123

C21 Java 367

C22 Perl 367

C33 JQuery 234

Network model:
In the network model of database, there are no levels and a record can have
any number of owners and also can have ownership of several records.
Thus, the problem raised above in the sales order processing will not arise
in the network model.

As there is no defnite path defned for retrieval of data, the number of links
is very large and thus network databases are complex, slow and dificult to
implement. In view of the dificulty in implementation, network model is
used only when all other options are closed.

The typical example of a network database may be the employee and the
department he/she has worked or can work with in future. Figure 9.5 shows
the network model of data for an employee information system.

You might also like