Professional Documents
Culture Documents
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
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
DBMS allows entities and relations among them to form tables. A user can understand the
architecture of a database.
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.
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 .
There are many kinds of data models. Some of the most common one includes-
1. Relational Model
3. Network 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.
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
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.
• 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.
Fig.
C CS DBMS
OS
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
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.
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
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.
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.
• 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.
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).
• To Comment – Comment
All of these commands either defines or update the database schema that’s why they come under Data
Definition language.
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.
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.