You are on page 1of 11

Dayanand Science College Latur.

CLASS: BSC TY Sub: RDBMS Prepared by : Dr. R. B. Shinde

UNIT-1
INTRODUCTION TO DBMS
Introduction : DBMS stands for Data Base Management System.
- Database Management System is a collection of interrelated data and a set of programs to
access that data.
- Database contains information related to an organization
- Primary goal of DBMS is to provide a way to store and retrieve database information which is
convenient & efficient.
- DBMS manages the large amount of information. Management of data involves the process of
defining structure for storage of information and provides the mechanism for the manipulation
of information.
- Besides this DBMS must ensure the safety of the stored information from unauthorized access.
- All these things are taken in account because most of the organization gives importance to the
data.

Definitions :
DATABASE :Any organization must have accurate and reliable data for effective decision marking such
related data is called a database.

DATABASE SYSTEM : It is an integrated collection of related files along with details of the interpretation
of the data contained within it.

DATABASE MANAGEMENT SYSTEM : DBMS is a software system that allows access of data contained in
a database. DBMS provides a convenient and effective method of defining, storing and retrieving the
information contained in the database. In addition DBMS exerts centralized control of the database and
prevents unauthorized users from accessing the data and ensures the privacy of the data.

Applications of DBMS :
Now a day database is widely used in every field of day to day life. Following are some examples,
Banking: In banking sector for storing customer information, accounts, loans and banking transactions.
Airlines: In airlines DBMS is used to store information of reservations and schedule information.
Universities: In universities DBMS is used to store the information of student, course, registrations and
grades.
Telecommunication: For keeping records of calls made, generating monthly bills, maintaining balances
on prepaid calling cards and storing information about the communication networks.
Finance: For storing information about holdings, sales and purchases of financial instruments such as
stocks and bonds. Also for storing real time market data to enable online trading by customers and
automated trading by the firm.
Sales: For storing customer, products and purchase information.
Dayanand Science College Latur.
CLASS: BSC TY Sub: RDBMS Prepared by : Dr. R. B. Shinde

Manufacturing: For tracking production of items in factories, inventories of item in warehouse and
stores, order for items.
Human Resources: For Information about employees, salaries, payroll taxes, benefits and for generation
of pay checks.

Characteristics of DBMS
Traditionally data was organized in file formats, DBMS was the new concept which overcome all
the deficiencies in traditional method. DBMS has following characteristics

1. Real World Entity:

DBMS uses real world entities to design its architecture. It uses the behavior and attributes too.

Ex. Student as an entry and their name, age, class are the attributes

Student

Sr. No. Name Class Age

2. Relation based tables:

DBMS allows entities and relations among them to form tables. A user can understand the
architecture of a database.

Student Relation Result Total


ship

Rol Name Class Rol No Sub 1 Sub 2


No

3. Less redundancy:

DBMS follows the rules of normalization, which splits a relation when any of its attribute is having
redundancy in values. Normalization is a mathematically rich and scientific process that reduces data
redundancy.

4. Consistency:

Consistency is a state where every relation is a database remains consistent. A DBMS can provide
greater consistency as compared to earlier forms of data storing application like file processing.

5. Query Language:
Dayanand Science College Latur.
CLASS: BSC TY Sub: RDBMS Prepared by : Dr. R. B. Shinde

DBMS is equipped with query language, which makes it more efficient to retrieve and manipulate data.
A user can apply as many and as different filtering options as required to retrieve a set of data.

6. ACID properties:

DBMS follows the concepts of Automicity, Consistency, Isolation and Durability. ACID properties help the
database stay healthy in multi transactional environments and in case of failure.

7. Multiuser and concurrent Access:

DBMS supports multi-user environment and allows then to access and manipulate data in parallel.

8. Multiple Views:

DBMS offers multiple views for different users. A user who is in the sales department will have a
different view of database then a person working in the production department. This feature enables
the users to have a concentrate view of the database according to their requirement.

9. Security:

Features like multiple views offer security to some extent where users are unable to access data of other
users and department. DBMS offers many different levels of security features which enables multiple
users to have different views with different features. Since DBMS is not saved on the disk as traditional
file system, it is very hard for miscreants to break the code.

Data Models
• A database model shows the logical structure of a database, including the relationship and
constraints that determine how data can be stored and accessed.
• Individual database models are designed based on the rules and concepts of whichever broader
data model the designer adopt.
• Most data models can be represented by an accompanying .

Types of database models:

There are many kinds of data models. Some of the most common one includes-

1. Relational Model

2. Hierarchical database model

3. Network Model

4. Object Oriented database model

Selecting a data model is also a matter of aligning your priorities for the database with the strengths of a
particular model, whether those priorities include speed, cost reduction, usability or something else.

1. Relational Model:
Dayanand Science College Latur.
CLASS: BSC TY Sub: RDBMS Prepared by : Dr. R. B. Shinde

• This is the most common model. The relational model sorts data into tables. Which is also known as
relations.
• Each table consist of columns and rows. Columns consist of attributes of the entity like roll number,
name, class etc.
• Attributes in relation are called domain. A particular attribute or combination of attributes are chosen
as primary key. This primary key is referred in to other tables.
• Each row also called a tuple, includes data about a specific instance of the entity such as student
information.

Relational model includes :

- One to one relation.


- One to many relation
- Many to many relation

Eg.
Rol No First Name Last Name Exam Seat No Result
1 Kedar Jadhav B001 Pass
2 Abdul Shaikh B002 Pass
3 Amar Sing B003 Pass

Rol No Exam Seat No Admission for Next Yr. Fees Paid


1 B001 No -----
2 B002 Yes 10,000
3 B003 Yes 12,000

Within the database tables can be normalized or brought to comply with normalization rules
that make the database flexible, adaptable and scalable. Relational database are typically written in
structured query language.

2. Hierarchical Data Model:


This is the first model in database design. Following diagram illustrates the hierarchical data
model.
Organization

Production Finance Technical


Department
Department Department

Manager Support Staff Cashier Cleark Engineers Support Staff


Dayanand Science College Latur.
CLASS: BSC TY Sub: RDBMS Prepared by : Dr. R. B. Shinde

Fig. Illustration of hierarchical data model

• In this data model data elements are linked in the form of an inverted tree structure. With the root
at the top and branches formed below.
• Below the single root data element sub co-ordinate element are there. Each of this sub co-ordinate
element may have one or more other elements. These elements are called child elements. Note that
in hierarchical data model brunches of root element are not connected with each other.
• Due to neat arrangement of element in hierarchical data model it is used in many database
applications.
• This type of system used primarily for file management system associated with operating system
because it allows user to go directly where they need to go to find a file rather than having its iterate
through lot of nodes.

3. Network Data Model:


• The Network Data Model is an extension of the hierarchical database structure. In this model the
data elements are organized in the form of parent-child relationship. And all types of relationship
among the data elements must be determined when the database is first designed.
• In this model a child data element can have more than one parent element or no parent at all.
• This type of system permits the drawing out of the needed information from any data element
instead of root elements only.
• This model have many to many relationship. Following figure illustrates network database model.

Fig.
C CS DBMS
OS

Veeda RAJ Kavya Shubhda

4. Object Oriented Database Model:


This model defines a database as a collection of objects, or reusable software elements with associated
features and methods. There are several kinds of objects-oriented database.

1. A Multimedia Database incorporated media, such as images that could not be stored in a relational
data.

2. A hypertext database allows any object to link to any other object. Its useful for organizing lots of
scattered data, but its not ideal for numerical analysis.
Dayanand Science College Latur.
CLASS: BSC TY Sub: RDBMS Prepared by : Dr. R. B. Shinde

What Is Database Architecture?


Database architecture uses programming languages to design a particular type of software for
businesses or organizations. Database architecture focuses on the design, development,
implementation and maintenance of computer programs that store and organize information for
businesses, agencies and institutions. A database architect develops and implements software to
meet the needs of users.
A Database Management system is not always directly available for users and applications to
access and store data in it. A Database Management system can be centralised(all the data stored
at one location), decentralised(multiple copies of database at different locations)
or hierarchical, depending upon its architecture.

The design of a DBMS depends on its architecture. It can be centralized or decentralized or


hierarchical. The architecture of a DBMS can be seen as either single tier or multi-tier. The tiers
are classified as follows :

1. 1-tier architecture

2. 2-tier architecture

3. 3-tier architecture

1-tier DBMS architecture also exist, this is when the database is directly available to the
user for using it to store data. Generally such a setup is used for local application development,
where programmers communicate directly with the database for quick response.

2-tier DBMS Architecture


2-tier DBMS architecture includes an Application layer between the user and the DBMS, which
is responsible to communicate the user's request to the database management
system and then send the response from the DBMS to the user.
An application interface known as ODBC(Open Database Connectivity) provides
an API that allow client side program to call the DBMS. Most DBMS vendors
provide ODBC drivers for their DBMS.

Such an architecture provides the DBMS extra security as it is not exposed to the
End User directly. Also, security can be improved by adding security and
authentication checks in the Application layer too.
Dayanand Science College Latur.
CLASS: BSC TY Sub: RDBMS Prepared by : Dr. R. B. Shinde

3-tier DBMS Architecture


3-tier DBMS architecture is the most commonly used architecture for web
applications.

It is an extension of the 2-tier architecture. In the 2-tier architecture, we


have an application layer which can be accessed programmatically to
perform various operations on the DBMS. The application generally
understands the Database Access Language and processes end users
requests to the DBMS.
In 3-tier architecture, an additional Presentation or GUI Layer is added,
which provides a graphical user interface for the End user to interact with
the DBMS.
For the end user, the GUI layer is the Database System, and the end user has
no idea about the application layer and the DBMS system.

Database Users & Administrators


Users of DBMS:
User of DBMS can be classified in the following groups depending on their way of interaction with the
DBMS

1. Naïve Users
2. Online Users
3. Applications Programmers
4. Database Administration

1. Naïve Users:
Any user who does not have any knowledge about database can be in this category. There task
is to just use the developed application and get the desired results. eg. ATM machine users they can use
the ATM for transaction purpose but they don’t have any DBMS knowledge, but they still use the
database and performs their given task.

2. Online Users:
These types of users communicate with the database directly through an online terminal or
indirectly through an application program and user interface. They know about the existence of the
database system and may have some knowledge about the limited interaction they are permitted.

3. Application Programmers:
They are the computer professionals who make the use of the system through languages. They
make the use of compilers assemblers and even test, debug the program. It is essential that application
Dayanand Science College Latur.
CLASS: BSC TY Sub: RDBMS Prepared by : Dr. R. B. Shinde

programmer might be familiar with the full range of facilities provided by the DBMS & can be capable of
using it.

4. Database Administrator:
The DBA is a person who have complete control over database of any enterprise. He is
responsible for overall performance of database. He is free to take decision & provides technical
support. He is concerned with the back-end of any project. Some of the main responsibilities of DBA are
as follows:

a. Deciding the conceptual schema are contents of database: DBA decides the data fields, tables,
queries, data types, attributes, relations, entities & everything.
b. Deciding the internal schema of structure of physical storage: DBA decides how the data is
actually stored at physical storage, how data is represented at physical storage.
c. Deciding Users: DBA gives permission to users to use database without having proper
permission no one can access data from database.
d. Deciding User View: DBA decides different views for different users.
e. Granting of authorities: DBA decides which user can use which portion of database. DBA gives
authorities or rights to data access. User can use only that data on which access right is granted
to him.
f. Deciding Constraints: DBA decides various constraints over database for maintaining
consistency and validity in database.
g. Security: Security is the major concern in the database. DBA takes various steps to make data
more secure against various disasters and unauthorized access of data.
h. Backup: DBA takes regular backup of database so that it can be used during system failure.
i. Checks: DBA also decides various security and validation checks over database to ensure
consistency.

Advantages and Disadvantages of DBMS


Following are some advantages of DBMS

1. Control of data redundancy: The database approach attempts to eliminate the redundancy by
integrating the file.
2. Data Consistency: By eliminating or controlling redundancy, the database approach reduces the
risk of inconsistencies occurring. It ensures all copies of the data are kept consistent.
3. More information from the same amount of data: it may be possible to derive additional
information for the same data.
4. Sharing of Data: In the multiple user database system data can be shared by all authorized
users.
5. Improved data integrity: The data value that are to be stored in the database must satisfy some
constraints (primary key, foreign key etc.) e.g. in the bank database 1000 rupees should be kept
balance is the condition for this purpose the developer enforces check constraints on the
balance field. This implementation of constraints into a database is called integrity.
Dayanand Science College Latur.
CLASS: BSC TY Sub: RDBMS Prepared by : Dr. R. B. Shinde

6. Security: As data is an important ingredient hence security of data becomes an important task.
The DBA who is responsible for ensuring such kind of security has to design proper
authentications methods for access of DBMS.
7. Flexibility: It may be necessary to change the structure of database as requirement changes.
The freedom which allows us to make changes into the structure of the database without
affecting most of the existing program satisfies flexibility.
8. Backup & Recovery: DBMS provides the facility of backup and recovery of data.

Disadvantages:
Following are some disadvantages of DBMS

1. Complexity: DBMS is an external complex piece of software. All parties must be familiar with its
functionality and take full advantages of it. Therefore training for the administrator, designer
and user is required.
2. Cost of DBMS: A multi user database management system may be very expensive. Even after
the installation, there is higher annual maintenance cost on the software.
3. Problem with centralization: We need centralized system to reduce duplication. If database
server gets crashed due to some reason then all the data will gets lost. To avoid the above
condition we can maintain the backup of database server.

Entity
An entity can be a real-world object, either animate or inanimate, that can be easily identifiable. For
example, in a school database, students, teachers, classes, and courses offered can be considered as
entities. All these entities have some attributes or properties that give them their identity.

An entity set is a collection of similar types of entities. An entity set may contain entities with attribute
sharing similar values. For example, a Students set may contain all the students of a school; likewise a
Teachers set may contain all the teachers of a school from all faculties. Entity sets need not be disjoint.

Attributes

Entities are represented by means of their properties, called attributes. All attributes have values. For
example, a student entity may have name, class, and age as attributes.

There exists a domain or range of values that can be assigned to attributes. For example, a student's
name cannot be a numeric value. It has to be alphabetic. A student's age cannot be negative, etc.

Types of Attributes
• Simple attribute − Simple attributes are atomic values, which cannot be divided further. For
example, a student's phone number is an atomic value of 10 digits.
Dayanand Science College Latur.
CLASS: BSC TY Sub: RDBMS Prepared by : Dr. R. B. Shinde

• Composite attribute − Composite attributes are made of more than one simple attribute. For
example, a student's complete name may have first_name and last_name.

• Derived attribute − Derived attributes are the attributes that do not exist in the physical database,
but their values are derived from other attributes present in the database. For example,
average_salary in a department should not be saved directly in the database, instead it can be
derived. For another example, age can be derived from data_of_birth.

• Single-value attribute − Single-value attributes contain single value. For example −


Social_Security_Number.

• Multi-value attribute − Multi-value attributes may contain more than one values. For example, a
person can have more than one phone number, email_address, etc.

Entity-Set and Keys


Key is an attribute or collection of attributes that uniquely identifies an entity among entity set.

For example, the roll_number of a student makes him/her identifiable among students.

• Super Key − A set of attributes (one or more) that collectively identifies an entity in an entity set.

• Candidate Key − A minimal super key is called a candidate key. An entity set may have more than
one candidate key.

• Primary Key − A primary key is one of the candidate keys chosen by the database designer to
uniquely identify the entity set.

DBMS languages
Database languages are used to read, update and store data in a database. There are several such
languages that can be used for this purpose; one of them is SQL (Structured Query Language).

Types of DBMS languages:


Data Definition Language (DDL)
DDL is used for specifying the database schema. It is used for creating tables, schema, indexes,
constraints etc. in database. Lets see the operations that we can perform on database using DDL:

• To create the database instance – CREATE


• To alter the structure of database – ALTER
• To drop database instances – DROP
• To delete tables in a database instance – TRUNCATE
• To rename database instances – RENAME
• To drop objects from database such as tables – DROP
Dayanand Science College Latur.
CLASS: BSC TY Sub: RDBMS Prepared by : Dr. R. B. Shinde

• To Comment – Comment

All of these commands either defines or update the database schema that’s why they come under Data
Definition language.

Data Manipulation Language (DML)


DML is used for accessing and manipulating data in a database. The following operations on database
comes under DML:

• To read records from table(s) – SELECT


• To insert record(s) into the table(s) – INSERT
• Update the data in table(s) – UPDATE
• Delete all the records from the table – DELETE

Data Control language (DCL)


DCL is used for granting and revoking user access on a database –

• To grant access to user – GRANT


• To revoke access from user – REVOKE

In practical data definition language, data manipulation language and data control languages are not
separate language, rather they are the parts of a single database language such as SQL.

Transaction Control Language(TCL)


The changes in the database that we made using DML commands are either performed or rollbacked
using TCL.

• To persist the changes made by DML commands in database – COMMIT


• To rollback the changes made to the database – ROLLBACK

COMMIT: -This command is used to permanently save any transaction into the database. When we
use any DML command like INSERT, UPDATE, or DELETE, the changes made by these commands are not
permanent, until the current session is closed. The changes made by these commands can be rolled back.
To avoid that, we use the COMMIT command to mark the changes as permanent.

ROLLBACK:- This command restores the database to last committed state. It is also used with
SAVEPOINT command to jump to a SAVEPOINT in an ongoing transaction. IF we have used the update
command to make some changes into the database, & relies that those changes were not required then
we can use the ROLLBACK command to rollback those changes. If they were not committed using the
COMMIT command.

You might also like