0% found this document useful (0 votes)
16 views

Unit-1

Uploaded by

avni patel
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Unit-1

Uploaded by

avni patel
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 63

563- The Mandvi Education Society Institute of

Computer Studies – MCA


Subject Code : 619404
Subject Name : Relational Database Management
System (RDBMS)
Unit – 1 Introduction to Database System

1
Introduct
What is Data? ion
•In simple words data can be facts related to any object in consideration.
•It means the single items that are stored in a database, either individually or
as a set.
•E.g. your name, age, height, weight, etc are some data related to you.
•E.g. In technical data means a text, number, a picture, audio file and video
files in binary format that be considered as data.

2
Introduct
What is Database? ion
•A database is a collection of information that is organized. So that it
can easily be accessed, managed, and updated.
•Database is a systematic collection of data. Databases support
storage and manipulation of data.
•Data in a database is primarily stored in database tables, which are organized
into columns and rows.
•E.g. An online telephone directory would definitely use database to
store data pertaining to people, phone numbers, other contact details, etc.

3
Introduct
What is DBMS ? ion
•Database Management System (DBMS) is a collection of programs which
enables its users to access database, manipulate data, reporting /
representation of data .
•A DBMS is responsible for:
–accessing data, inserting, updating, and deleting data, security,
supporting batch, backups and recoveries, maximizing
facilitating
availability, maintain directory of database objects, managing the buffer
pools, acting as an interface to other systems programs, supporting user
interface packages, SQL and many more…

4
Drawbacks of Traditional File
Processing System
1) Data Redundancy – duplication of data.
2) Data Inconsistency – data inconsistency occur due
to duplication of data when we update and delete data.
3) Lack of Data Integration – difficult to access data from
many files and it’s integration.
4) Program Dependence – files are program dependence.
5) Limited Data Sharing – limited to share data over network.
6) Poor Data Control - There was no centralised control at
the data element level.

5
Characteristics of the Database
Approach
•In the database approach, a single repository maintains data that is
defined once and then accessed by various users.
•In a database, the names or labels of data are defined once,
and used repeatedly by queries, transactions, and applications.
•The main characteristics of the database approach versus the file-
processing approach are the following:
•Self-describing nature of a database system
•Insulation between programs and data, and data abstraction
•Support of multiple views of the data
•Sharing of data and multiuser transaction processing

6
Characteristics of the Database
Approach
1. Self-Describing Nature of a Database System
•In database system contains not only the database itself but also a
complete definition or description of the database structure and
constraints.
•E.g. Structure of each file, the type and storage format of each
data item, and various constraints on the data.

7
Characteristics of the Database
Approach
2. Insulation between Programs and Data, and Data Abstraction:
•In traditional file processing, the structure of data files is
embedded in the application programs, so any changes to the
structure of a file may require changing all programs that access
that file.
•If we want to add another piece of data to each STUDENT record,
say the Birth_date, then what happened?
•The structure DBMS store data and program separately.
•In a DBMS environment, we only need to change the description
of STUDENT records in the catalog to reflect the inclusion of the
new data item Birth_date; no programs are changed.
8
Characteristics of the Database
Approach
3. Support of Multiple Views of the Data
•A multiuser DBMS whose users have a variety of distinct
applications must provide facilities for defining multiple views.
•E.g. A one user of the database may be interested only in
accessing and printing the transcript of each student and a second
user is interested only in checking that students have taken all the
prerequisites of each course for which they register.

9
Characteristics of the Database
Approach
4. Sharing of Data and Multiuser Transaction Processing
•A multiuser DBMS, as its name implies, must allow multiple users
to access the database at the same time. This is essential if data for
multiple applications is to be integrated and maintained in a single
database. The DBMS must include concurrency control software to
ensure that several users trying to update the same data do so in a
controlled manner so that the result of the updates is correct.
•E.g. Several reservation agents try to assign a seat on an airline
flight, the DBMS should ensure that each seat can be accessed by
only one agent at a time for assignment to a passenger.

10
Actors on the
Scene
In large organizations, many people are involved in the design,
use, and maintenance of a large database with hundreds of users.
In this section we identify the people whose jobs involve the day-
to-day use of a large database; we call them the actors on the
scene that are follows:
•1. Database Administrators
•2. Database Designers
•3. End Users
•4. System Analysts and Application Programmers
Actors on the
Scene
1. Database Administrators:
•In any organization where many people use the same resources,
there is a need for a chief administrator to oversee and manage
these resources.
•In a database environment, the primary resource is the database
itself, and the secondary resource is the DBMS and related
software.
•The DBA is responsible for authorizing access to the database,
coordinating and monitoring its use, and acquiring software and
hardware resources securely as needed.
Actors on the
Scene
2. Database Designers:
•They are responsible for identifying the data to be stored in the
data-base and for choosing appropriate structures to represent and
store this data.
•Responsibility of database designers to communicate with
all
prospective database users in order to their
requirements and understand create
to
requirements. a design that meets these
•In many cases, the designers are on the staff of the DBA and may
be assigned other staff responsibilities after the database design is
completed.
Actors on the
3. End Users: Scene
They are the people whose jobs require access to the database for
querying, updating, and generating reports.
There are several categories of end users:
• 3.1 Casual end users - occasionally access the database, but they may
need different information each time. They use a sophisticated database
query language to specify their requests and are typically middle- or high-
level managers or other occasional browsers.
• 3.2 Naive or parametric end users – Work with some portion of
database, their main job is constantly querying (standard types of queries
transactions—that have been carefully programmed and tested) and
updating the database.
Actors on the
3. End Users: Scene
There are several categories of end users:
• 3.3 Sophisticated end users include engineers, scientists, business
analysts, and others who thoroughly familiarize themselves with the
facilities of the DBMS in order to implement their own applications to
meet their complex requirements.
• 3.4. Standalone users maintain personal databases by using ready-made
pro-gram packages that provide easy-to-use menu-based or graphics-
based interfaces. An example is the user of a tax package that stores a
variety of personal financial data for tax purposes.
Actors on the
4. System Analysts Scene
and Application Programmers:
1.System analysts determine the requirements of end users,
especially naive and parametric end users, and develop
specifications for standard scanned transactions that meet these
requirements.
2.Application programmers implement these specifications as
programs; then they test, debug, document, and maintain these
transactions.
•E.g. They are commonly referred as
Software developers or Software engineers.
Workers behind the
Scene
In addition to those who design, use, and administer a database, others are
associated with the design, development, and operation of the
DBMS software and system environment.
These persons are typically not interested in the database content itself. We
call them the workers behind the scene, and they include the following
categories:
1. DBMS system designers and implementers design and implement
the DBMS modules and interfaces as a software package, responsibility is
implementing the catalog, query language processing, interface processing,
accessing and buffering data, controlling concurrency, and handling data
recovery and security.
Workers behind the
2.Tool developers - Scene
design and implement tools that facilitate
database modelling and design, database system design, and improved
performance. Tools are optional packages that are often purchased
separately, they include packages for database design, performance
monitoring, natural language or graphical interfaces, prototyping, and test
data generation.
3.Operators and maintenance personnel – they are responsible for the
actual running and maintenance of the hardware and software environment
for the database system.
Advantages of Using the DBMS
Approach
In this section we discuss some of the advantages of using a DBMS and the
capabilities that a good DBMS should possess.

•1. Controlling Redundancy


•2. Restricting Unauthorized Access
•3. Providing Persistent Storage for Program Objects
•4. Data Security
•5. Providing Backup and Recovery
•6. Data Integrity
Advantages of Using the DBMS
Approach
1. Controlling Redundancy:
This redundancy in storing the same data multiple times leads to several
problems.
• First, there is the need to perform a single logical update such as
entering data on a new student multiple times: once for each file
where student data is recorded. This leads to duplication of effort.
• Second, storage space is wasted when the same data is stored
repeatedly, and this problem may be serious for large databases.
• Third, files that represent the same data may become
inconsistent. This may happen because an update is applied to some of
the files but not to others.
So this can be solve by data normalization and demoralized process.
Advantages of Using the DBMS
Approach
2. Restricting Unauthorized Access:
•When multiple users share a large database, it is likely that most users will
not be authorized to access all information in the database.
•E.g. Financial data is often considered confidential, and only authorized
persons are allowed to access such data.
•A DBMS should provide a security and authorization subsystem, which the
DBA(Database Administrator) uses to create accounts and to specify account
restrictions.
•E.g. Only the DBA’s staff may be allowed to use certain privileged software,
such as the software for creating new accounts.
Advantages of Using the DBMS
Approach
3. Providing Persistent Storage for Program Objects:
•Databases can be used to provide persistent storage for program objects
and data structures. This is one of the main reasons for object-oriented
database systems.
•The values of program variables or objects are discarded once a program
terminates, unless the programmer explicitly stores them in permanent
files, which often involves converting these complex structures into a format
suitable for file storage.
•Here, object is said to be persistent, since it survives the termination of
program execution and can later be directly retrieved by another C++
program.
Advantages of Using the DBMS
Approach
4. Data Security
Data security is vital concept in a database. Only authorized users should
be allowed to access the database and their identity should be
authenticated using a username and password.
Unauthorized users should not be allowed to access the database under
any circumstances as it violates the integrity constraints.
Advantages of Using the DBMS
Approach
5. Providing Backup and Recovery:
A DBMS automatically takes care of backup and recovery. The users don’t
need to backup data periodically because this is taken care of by the DBMS.
Moreover, it also restores the database after a crash or system failure to its
previous condition.
E.g. If the computer system fails in the middle of a complex update
transaction, the recovery subsystem is responsible for making sure that
the database is restored to the state it was in before the transaction
started executing.
Advantages of Using the DBMS
Approach
6. Data Integrity
• Data integrity means that the data is accurate and consistent in the
database.
• It is very important as there are multiple database in a DBMS.
• All of these database contain data that is visible to multiusers. So it
necessary to ensure that the data is correct and consistent in all the
database and for all the users.
Database System Concepts
and Architecture
Data Models
•Data Model gives us an idea that how the final system will look like after
its complete implementation.
•It defines the data elements and the relationships between the
data elements.
•Data Models are used to show how data is stored, connected,
accessed and updated in the database management system.
•Here, we use a set of symbols and text to represent the information so
that members of the organisation can communicate and understand it.
•Though there are many data models being used nowadays but
the
Relational model is the most widely used model.
•Apart from the Relational model, there are many other types of
data models about which we will study in detail.
Data Models
•Some of the Data Models in DBMS are:
1. Hierarchical Model
2. Network Model
3. Entity-Relationship Model
4. Relational Model
5. Object-Oriented Data Model
6. Object-Relational Data Model
7. Flat Data Model
8. Semi-Structured Data Model
9. Associative Data Model
10. Context Data Model
[Link : https://afteracademy.com/blog/what-is-data-model-in-dbms-and-what-
are-its-types]
Schemas
•The design of the database is called a schema. This tells us about the
structural view of the database.
•It gives us an overall description of the database.
•A database schema defines how the data is organised using the
schema diagram.
•A schema diagram is a diagram which contains entities and the
attributes that will define that schema.
•A schema diagram only shows us the database design. It does not
show the actual data of the database.
•Schema can be a single table or it can have more than one table which
is related.
•The schema represents the relationship between these tables.
Schemas
Example: Let us suppose we have three tables Employee, Department and
Project. So, we can represent the schema of these three tables using the
schema diagram as follows. In this schema diagram, Employee and
Department are related and the Employee and Project table are related.
Schemas
Schemas
There are three levels of the schema. The three levels of the
database schema are defined according to the three levels
of data abstraction.
1. View Schema
2. Logical Schema
3. Physical Schema

Data Abstraction refers to the process of


hiding irrelevant details from the user.
Schemas

[Link : https://afteracademy.com/blog/what-is-a-schema]
What is a data model v/s
A data modelschema?
can, for example, be a relational model where the data will be
organized in tables whereas the schema for this model would be the set of
attributes and their corresponding domains.
Instan
•The data stored in database at a particular moment of time is
called instance of database.
ces
•Database schema defines the variable declarations in tables that belong to a
particular database; the value of these variables at a moment of time is called
the instance of that database.
•For example, lets say we have a single table student in the database, today
the table has 100 records, so today the instance of the database has 100
records.
•Lets say we are going to add another 100 records in this table by tomorrow
so the instance of database tomorrow will have 200 records in table.
•In short, at a particular moment the data stored in database is called the
instance, that changes over time when we add or delete data from the
database.
Difference between Schema & Instance
SCHEMA INSTANCE

It is the collection of information


It is the overall description of the stored in a database at a particular
database. moment.

Data in instances can be changed using


Schema is same for whole database. addition, deletion, updation.

Does not change Frequently. Changes Frequently.

Defines the basic structure of the


database i.e. how the data will be It is the set of Information stored at a
stored in the database. particular time.
Three-Schema
Architecture
•Three-Schema Architecture: It is to achieve and visualize
these characteristics.
•It’s goal is to separate the user applications from the physical database
by following three levels:
Three-Schema
Architecture
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.
Three-Schema
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
•Data independence canIndependence
be explained using the three-schema architecture.
•Data independence refers characteristic of being able to modify the
schema at one level of the database system without altering the schema at
the next higher level.
•We can define two types of data independence:

1) Logical Data Independence


• Logical data independence refers characteristic of being able to change the
conceptual schema without having to change the external schema.
•Logical data independence is used to separate the external level from the
conceptual view.
•If we do any changes in the conceptual view of the data, then the user
view of the
data would not be affected.
•Logical data independence occurs at the user interface level.
Data
Independence
2) 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.
•Physical data independence is used to separate conceptual levels from the internal
levels.
•Physical data independence occurs at the logical interface level.
Database Language &
Here, we discuss types of languages and interfaces provided by a DBMS and the user
Interfaces
categories that targeted by each interface.
DBMS Languages: that we can see in next figure
1) Data Definition Language (DDL)– it used to define the database
schema,
modify the structure of database objects in database using below command.
E.g. CREATE, DROP, ALTER, TRUNCATE, COMMENT and RENAME object

2) Data Manipulation Language (DML) – it deals with the manipulation of data


present in database belong to DML using below command..
E.g. SELECT, INSERT, UPDATE and DELETE.

3) Data Control Language (DCL) – deals with the rights, permissions and other
controls of the database system using below command..
E.g. GRANT and REVOKE
Database Language &
4) TransactionInterfaces
Control Language (TCL) – perform transactions within the database
using below command..
E.g. COMMIT, ROLLBACK, SAVEPOINT and SET TRANSACTION
Reference - https://www.geeksforgeeks.org/sql-ddl-dml-dcl-tcl-commands/
Database Language &
Interfaces
DBMS Interfaces: A database management system (DBMS) interface is
a user interface which allows for the ability to input queries to a
database without using the query language itself.
User-friendly interfaces provide by DBMS may include the following:
•Menu-based Interfaces for Web Clients or Browsing - These interfaces
present the user with lists of options (called menus) that lead the user
through the formulation of a request. E.g. Pull-down menus are a very
popular technique. E.g.
•Lets say you are searching for some item on a shopping website.
•First thing you do is go the categories menu and select the category in which
the item falls.
•Then you select the brand from the menu of brands.
•Then you search through different models of that item in the menu.
•Then you might select the budget you have from the menu of budget range.
Database Language &
Interfaces
•Apps for Mobile Devices - These interfaces present mobile users with
access to their data. E.g. apps that allow users to access their data
through a mobile phone or any other devices
•Forms-based Interfaces - A forms-based interface displays a form to
each user.
E.g. users can fill out all of the form entries to insert new data or
teacher adding the attendance of students in the system.
Or a student entering his roll number, class and
branch in a form to retrieve his or her exam results.
Database Language &
Interfaces
•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.
•Example Lets say, you want to find out what is the fastest car in the world, so you
search for fastest car in India on a search engine like Google, which is a natural
language interface.
•The Natural language interface then looks at the important words in the input by
the user: Fastest, car, India.
•Now it will go into the database of cars and search for all the cars that are available
in India. Then it will check the car with highest speed among the cars available in
India. And finally it will show the outcome of the search to the user.
Database Language &
•Keyword-based Database Search - These are somewhat similar to Web
Interfaces
search engines, which accept strings of natural language (like English or
Spanish) words and match them with documents at specific sites (for
local search engines) or Web pages on the Web at large.
E.g., Google or Ask.
•Graphical User Interfaces - A GUI means diagrammatic form. E.g. In
many cases, GUIs utilize both menus and forms.
Example of GUI Lets say you are watching video on YouTube.
•If you press that subscribe button, either with a finger or a mouse, it will turn grey.
•There are forms used in YouTube too, like you search some topic on YouTube.
•There are Menus also used on YouTube, like YouTube shows you different videos on
different channels, also it gives you menu to select videos of certain length or from
certain time.
•And all this interface is visually graphics and changes according the action the
user
takes. Hence Graphical User Interface.
Database Language &
•Speech Input Interfaces
and Output - Limited use of speech as an input query and
speech as an answer to a question or result of a request is becoming
common place.
E.g. The speech input is detected using a library of predefined words and used to set
up the parameters that are supplied to the queries.
•Most of you must have used either Siri on apple, or OK google, or Alexa or Cortana to
ask some questions like,
•“OK, google, find the value of square root of 729”
•“Or Alexa, what is the capital of Nepal”
•And these speech user interfaces interpret your speech input and processes the data
from the database and after successful interpretation answers you back in speech.
•If the query is not understood, it will ask you to repeat the query.
Database Language &
Interfaces
•Interfaces for Parametric Users - Parametric users, such as bank tellers, often
have a small set of operations that they must perform repeatedly. E.g. A
Automated Teller Machine (ATM) is able to use single function keys to invoke
routine and repetitive transactions such as account deposits or withdrawals, or
balance inquiries.

•Interfaces for the DBA - Most database systems contain privileged commands
that can be used only by the DBA staff. E.g. commands for creating accounts,
setting system parameters, granting account authorization, changing a schema,
and reorganizing the storage structures of a database.
Database System Environment
A DBMS is a complex software system. In this section we discuss the
types of software components that constitute a DBMS and the types of
computer system software with which the DBMS interacts.
1. DBMS Component Modules - Here, below figure is divided into two
parts.
First, top part contains various users of the database environment
and their interfaces.
Second, lower part shows the internal modules of the DBMS
responsible for storage of data and processing of transactions.
Database System Environment
Database System Environment
2.Database System Utilities – It helps the DBA manage
the database system.
• Loading – It used to load existing data files, E.g. text files load
into database.

•Backup – create backup of databases.

•Database Storage Reorganization - reorganize a set of database files


into different file organizations and create new access paths.

•Perform Monitoring – used to monitor database usage and provide


statistics to the DBA.
Database System Environment
3. Tools, Application Environments, and Communications Facilities –
these some tools are available to database designers, users:
•Data Dictionary – used to store information about schemas and constraints.

•Information Repository – it stores other information, such as design


decisions,
usage standards, application program descriptions, and user information.

•Application Development Environments – provide database design, GUI


development, querying and updating, and application program development. E.g.
PowerBuilder (Sybase) and Jbuilder (Borland).

•Communication Software’s - for data communications, E.g. DB/DC system.

[Link: http://www.brainkart.com/article/The-Database-System-Environment_11401/]
Centralized and Client / Server
Architecture
Centralized for DBMS’s
DBMSs Architecture:
• Traditional older systems access database on same computer terminals
with less processing power capabilities therefore, client server
architecture come into the pictures. By this we can decrease hardware
cost.
• In client server architecture many clients access data from the central
server located remotely using communications networks like below
figure.
Centralized and Client / Server
Architecture for DBMS’s
Centralized and Client / Server
•Architecture for DBMS’s
Basic Client/Server Architectures:
•The client/server architecture was developed to deal with computing
environments in which a large number of PCs, workstations, file servers,
printers, database servers, Web servers, e-mail servers, and other
software and equipment are connected via a network that look like below
figure:.
Centralized and Client / Server Architecture
for DBMS’s
Basic Client/Server Architectures:
Client – Is a user machine that provides user interface
capabilities and local processing and request database access,
it connects to a server that provides the needed functionality.

Server – It is a system containing both hardware and software


that can provide services to the client machines, such as file
access, printing, archiving, or database access.
Centralized and Client / Server Architecture
for DBMS’s
Basic Client/Server Architectures:
There are two main types of basic DBMS architectures that
are follows:
1. Two-tier
2. Three-tier or N-Tier.
1. Two-Tier: In this the software components are distributed over
two systems: client and server, as illustrated in below Figure:

Advantages: Its simplicity and seamless compatibility


with existing systems.
Centralized and Client / Server
Architecture for DBMS’s
Centralized and Client / Server
Architecture for DBMS’s
Basic Client/Server Architectures:

2. Three-Tier: In this adds an intermediate layer between the client and the
database server, as illustrated in below figure.
This intermediate layer or middle tier is called the application server or the
Web server, depending on the application.
This server plays an intermediary role by running application programs and
storing business rules (procedures or constraints) that are used to access
data from the database server.

Advantages: Improve database security by checking a client’s credentials


before forwarding a request to the database server.
Centralized and Client / Server
Architecture for DBMS’s
Classifications of Database Management Systems
Several criteria can be used to classify DBMSs:
•Data model on which the DBMS is based – here DBMS classified
according to different models, E.g. Relational, Hierarchical, Object
based, XML and so on.
•Number of users supported by the system – Single user or Multi
users.
•Number of sites over which the database is distributed –
Database stored in single server or distributed among different
servers at multiple sites, E.g. Homogeneous DDBMSs use the same
DBMS software at all the sites, whereas heterogeneous DDBMSs
can use different DBMS software at each site.
•DDBMS = Distributed DataBase Management System
Classifications of Database Management Systems
Several criteria can be used to classify DBMSs:
•Cost - It is difficult to propose a classification of DBMSs based on
cost. Today we have open source (free) DBMS products like MySQL
and PostgreSQL that are supported by third-party vendors with
additional services.

•Types of access path – In this we care about access path of storing


files.

You might also like