DATABSAE MANAGEMENT
SYSTEM
• DBMS stands for database management system.
• Database: is what we store, like users data, student data, employee data etc stored as
structured way or organised way.
• The values in the database is managed,created ,accesed ,administrated we call it as db
managemnt system.
• Ex: database is Digital library ( here we need a librarian to manage.)
Key features:
1.Data storage:
• Data organisation: data is stored in a
structured way.
Structure like Tables (ROWS AND COLUMNS)
• Data types: numbers, text, date format, binary
etc
2. Data retrieval:after storing we need to retriev
the data so we use data queries.
3. Data manipulation:
• Create
• Update
• Delete
All these operations are done by using queries .
4. Data security
Access control: we will put restrictions like which user can access
the data .
Encryption:unauthorised access is restricted ,our data will be
encrypted.
• Where we use DBMS?
Schools, colleges,hospitals,banks etc….
Unit 1
Introduction to Database System Applications.:
• A database is a collection of related data.
• A database management system (DBMS) is a computerized
system that enables users to create and maintain a database.
• The DBMS is a general-purpose software system that
facilitates the processes of defining, constructing,
manipulating, and sharing databases among various users
and applications.
• Defining a database involves specifying the data types,
structures, and constraints of the data to be stored in the
database.
• Constructing the database is the process of
storing the data on some storage medium that is
controlled by the DBMS.
• Manipulating a database includes functions such
as querying the database to retrieve specific data,
updating the database to reflect changes in the
miniworld, and generating reports from the data.
• Sharing a database allows multiple users and
programs to access the database simultaneously.
• A query typically causes some data to be
retrieved;
• Transaction may cause some data to be read
and some data to be written into the
database.
Characteristics of the Database Approach(page no.10)
• a single repository maintains data that is defined once and then accessed by various
users repeatedly through queries, transactions, and application programs.
• The main characteristics of the database approach versus the file-processing
approach are the following:
■ Self-describing nature of a database system:
A fundamental characteristic of the database approach is that the database system
contains not only the database itself but also a complete definition or description of
the database structure and constraints.
This definition is stored in the DBMS catalog, which contains information such as
the structure of each file, the type and storage format of each data item, and
various constraints on the data.
The information stored in the catalog is called meta-data, and it describes the
structure of the primary database
It is important to note that some newer types of database systems, known as
NOSQL systems, do not require meta-data.
Rather the data is stored as self-describing data that includes the data item names
and data values together in one structure .
The catalog is used by the DBMS software and also by database users who need
information about the database structure.
■ Insulation between programs and data, and data abstraction:
The structure of data files is stored in the DBMS catalog separately from the access
programs. We call this property program-data independence.
■ Support of multiple views of the data:
A database typically has many types of users, each of whom may require a different
perspective or view of the database.
A view may be a subset of the database or it may contain virtual data that is derived from
the database files but is not explicitly stored.
For example, one user of the database may be interested only in accessing and printing
the transcript of each student
A second user, who is interested only in checking that students have taken all the
prerequisites of each course for which the student registers
■ Sharing of data and multiuser transaction processing :
t 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
Data models
• A data model is a collection of concepts that can be used to describe the
structure of a database.
Categories of Data Models
1. High-level or conceptual data models: provide concepts that are close to
the way many users perceive data.
2. Low-level or physical data models :provide concepts that describe the
details of how data is stored on the computer storage media, typically
magnetic disks. Concepts provided by physical data models are generally
meant for computer specialists, not for end users.
3. Representational (or implementation) data models: which provide
concepts that may be easily understood by end users but that are not too
far removed from the way data is organized in computer storage.
Representational data models hide many details of data storage on disk
but can be implemented on a computer system directly.
4. Conceptual data models : use concepts such as
entities, attributes, and relationships.
• An entity represents a real-world object or
concept,. (employee or project described in
database)
• An attribute represents some property of interest
that further describes an entity, such as the
employee’s name or salary.
• A relationship among two or more entities
represents an association among the entities.
Database Schema
• The description of a database is called the
database schema.
Database Architecture
Three-Schema Architecture
• The goal of the three-schema architecture is to separate
the user applications from the physical database.
• In this architecture, schemas can be defined at the
following three levels:
1. The internal level
• Has an internal schema, which describes the physical
storage structure of the database.
• The internal schema uses a physical data model and
describes the complete details of data storage and access
paths for the database.
2.The conceptual level:
• has a conceptual schema, which describes the structure of the whole
database for a community of users.
• The conceptual schema hides the details of physical storage structures
and concentrates on describing entities, data types, relationships, user
operations, and constraints.
• Usually, a representational data model is used to describe the conceptual
schema when a database system is implemented.
• This implementation conceptual schema is often based on a conceptual
schema design in a high-level data model.
3. The external or view level
• includes a number of external schemas or user views.
• Each external schema describes the part of the database that a particular
user group is interested in and hides the rest of the database from that
user group.
• As in the previous level, each external schema is typically implemented
using a representational data model, possibly based on an external
schema design in a high-level conceptual data model.
• The three-level ANSI architecture has an
important place in database technology
development because it clearly separates the
users’ external level, the database’s
conceptual level, and the internal storage level
for designing a database
Data Independence
• Capacity to change the schema at one level of a database
system without having to change the schema at the next
higher level.
Two types:
1. Logical data independence :
is the capacity to change the conceptual schema without
having to change external schemas or application programs.
We may change the conceptual schema to expand the
database (by adding a record type or data item), to change
constraints, or to reduce the database (by removing a
record type or data item).
2.Physical data independence : is the capacity to
change the internal schema without having to change
the conceptual schema.
• Physical data independence exists in most databases
and file environments where physical details, such as
the exact location of data on disk, and hardware
details of storage encoding, placement, compression,
splitting, merging of records, and so on are hidden
from the user.
Data independence occurs because when the schema
is changed at some level, the schema at the next
higher level remains unchanged
Only the mapping between the two levels is changed.
DBMS Languages
• Database languages are specialized programming languages used to define, manipulate, and
control data within a database management system (DBMS). They are broadly categorized into
four main types:
Data Definition Language (DDL):
• This language is used to define and modify the structure of the database.
• It is used to define and modify the structure of the database itself, including the tables, views,
indexes and other schema-related objects.
• It deals with the creation and modification of database schema.
Commands include:
• CREATE: To create database objects like tables, views, or indexes.
• ALTER: To modify the structure of existing database objects.
• DROP: To delete database objects.
• TRUNCATE: To remove all records from a table while keeping the structure.
• RENAME: Used to change the name of a database object
Data Manipulation Language (DML):
• This language is used to manipulate and retrieve data stored within the database.
• you can perform various operations such as inserting, updating, selecting and deleting data
Commands include:
• SELECT: To retrieve data from the database.
• INSERT: To add new records into a table.
• UPDATE: To modify existing records in a table.
• DELETE: To remove records from a table.
Data Control Language (DCL):
• This language manages access and permissions within the database.
Commands include
• GRANT: To provide specific privileges to users.
• REVOKE: To remove privileges previously granted to users.
Transaction Control Language (TCL):
• This language manages transactions, ensuring data integrity and
consistency.
Commands include
• COMMIT: To save changes made during a transaction permanently.
• ROLLBACK: To undo changes made during a transaction.
• SAVEPOINT: To set a point within a transaction to which you can later roll
back
DBMS INTERFACES(GUI’s)
• A database management system (DBMS) interface is a user interface that
allows for the ability to input queries to a database without using the
query language itself.
• User-friendly interfaces provided by DBMS may include the following:
Menu-Based Interfaces
• These interfaces present the user with lists of options (called menus) that
lead the user through the formation of a request. The basic advantage of
using menus is that they remove the tension of remembering specific
commands and syntax of any query language.
• The query is basically composed step by step by collecting or picking
options from a menu that is shown by the system. Pull-down menus are a
very popular technique in Web-based interfaces. They are also often
used in browsing interfaces which allow a user to look through the
contents of a database in an exploratory and unstructured manner.
Forms-Based Interfaces
• A forms-based interface displays a form to each user. Users can fill out
all of the form entries to insert new data, or they can fill out only
certain entries, in which case the DBMS will redeem the same type of
data for other remaining entries.
• These types of forms are usually designed or created and programmed
for users that have no expertise in operating systems. Many DBMS's
have form specification languages which are special languages that
help specify such forms.
• Example: SQL Forms is a form-based language that specifies queries
using a form designed in conjunction with the relational database
schema.
Graphical User Interface
• A GUI typically displays a schema to the user in diagrammatic form.
The user then can specify a query by manipulating the diagram. In
many cases, GUI utilise both menus and forms. Most GUI use a
pointing device such as a mouse, to pick a certain part of the displayed
schema diagram.
Natural Language Interfaces
• These interfaces accept requests written in English or some other language and
attempt to understand them. A Natural language interface has its own schema,
which is similar to the database conceptual schema as well as a dictionary of
important words.
The natural language interface refers to the words in its schema as well as to the
set of standard words in a dictionary to interpret the request. If the
interpretation is successful, the interface generates a high-level query
corresponding to the natural language and submits it to the DBMS for
processing, otherwise, a dialogue is started with the user to clarify any provided
condition or request.
• The main disadvantage of this is that the capabilities of this type of interface are
not that advance.
Speech Input and Output Interfaces
• There is limited use of speech be it for a query or an answer to a question or
being a result of a request it is becoming commonplace. Applications with
limited vocabulary such as inquiries for telephone directory, flight
arrival/departure, and bank account information are allowed speech for input
and output to enable ordinary folks to access this information.
• The Speech input is detected using predefined words and used to set up the
parameters that are supplied to the queries. For output, a similar conversion
from text or numbers into speech takes place.
Interface for Parametric Users
• Interfaces for Parametric Users contain some
commands that can be handled with a minimum of
keystrokes. It is generally used in bank transactions
for transferring money. These operations are
performed repeatedly.
Interfaces for Database Administrators (DBA)
• Most database system contains privileged
commands that can be used only by the DBA's
staff. These include commands for creating
accounts, setting system parameters, granting
account authorization, changing a schema, and
reorganizing the storage structures of databases.
Classification of DBMS
Relational DBMS (RDBMS):
• This is the most common type, where data is organized into tables with
rows and columns, and relationships are established using
keys. Examples include MySQL, PostgreSQL, and Oracle.
Hierarchical DBMS:
• Data is structured in a tree-like format with parent-child relationships,
where a child can have only one parent.
Network DBMS:
• Allows more flexible relationships than hierarchical, where a child can
have multiple parents.
Object-Oriented DBMS (OODBMS):
• Data is stored as objects with attributes and methods, supporting
concepts like inheritance, encapsulation, and polymorphism.
• NoSQL DBMS:
• Designed for handling large volumes of unstructured or semi-structured data, with
different types like document, key-value, column-family, and graph databases.
2. By Number of Users:
• Single-user DBMS: Supports only one user at a time.
• Multi-user DBMS: Supports multiple users concurrently.
3. By Distribution:
• Centralized DBMS: Stores all data in a single location.
• Distributed DBMS: Distributes data across multiple locations.
• Homogeneous DDBMS: All sites use the same DBMS software.
• Heterogeneous DDBMS: Different sites may use different DBMS software.
4. Other Classifications:
• General-purpose DBMS: Designed to meet the needs of a wide range of
applications.
• Special-purpose DBMS: Designed for specific applications like online transaction
processing (OLTP).
• Active DBMS: Actively monitors data and events and can trigger actions based on
predefined rules.
• Passive DBMS: Relies on user or application requests to initiate operations.