Unit-1
Unit-1
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.
[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
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:
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.
[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.
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.