0% found this document useful (0 votes)
26 views41 pages

DBMS 1

Uploaded by

ayusssssh100
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views41 pages

DBMS 1

Uploaded by

ayusssssh100
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 41

CHAPTER 1: INTRODUCTION TO

DBMS

6th Semester
Dept. of CSE & AIML
Basic Terms
• Data: Raw facts which does not have meaning of its own.
• When data is processed it becomes an information

• An information can further be treated as data and further


processed to generate another information.

• Database: A collection of related data that has a implicit


meaning.

• DBMS: The DBMS is the set of programs /tools used to


create and maintain database.
Database facilitates:

1. Defining: Datatypes, structures and Constraints

2. Constructing: Storing on some medium that is


controlled by DBMS.

3. Manipulating: Retrive, update and to generate reports.


Characteristics of DBMS
Self-Describing Nature:
• It has a system catalog. It contains information such as
structure of each file, the storage format and also the
various constraints. It is also called as metadata (data
about data).
• A metadata does not only defines or describes, type, structure and
format of all data but also relationship between data.

• In traditional file system, data definition is typically part


of the application program.
Insulation Between Data and Program:
• Structure of data files is not stored in the program but it is
stored in DBMS catalogue separately.
• This property is called as program-data independence.

• In traditional file system, the structure of data files are


included in the program itself. So any changes made in
structure of file may require changing all the program.

Supports multiple views of data:


• Support multiple views of data to the users.
• Users can have multiple views of database depending on
their interest.
• View can be a subset of database.
Concurrent use of Database:
• Many users might be accessing the data at the same time.
• They may require altering the database system
concurrently.
• DBMS has a concurrent control mechanism which allows
them to concurrently use database without any problem.
• For example: When several reservation clerk try to assign a seat on
an airline flight.

• This type of application are generally called as online


transaction processing (OLTP) application.
Controlling Redundancy:
• Storing same data multiple times is called redundancy.
• In traditional file systems, if there are two departments
(admission and finance) then each user will keep file
independently for a student. Much of these data are stored
twice which leads to problems like:
• Storage space is wasted
• Data may become inconsistent.
• Manipulating of data becomes difficult.

• DBMS controls redundancy, the view of different user groups


are integrated during database design.
Restricting unauthorized access:
• DBMS provides security to the data stored in it because all
users have different rights to access database.
• Some of the user can access the whole database while other
can access a small part of database.

Providing Multiple user Interface:


• Query language interface for casual user.
• Programming language interface for application programmer.
• Forms based and command codes for parametric users
• Menu driven interface for stand-alone users
Enforcing Integrity Constraints:
• DBMS has a capabilities to enforce integrity constraints on
data.
• The simplest type of integrity constraints is specifying a
data type for a data items.
• Another type of constraints could be specifying
uniqueness on data items.

Providing Backup and Recovery:


• There are many chances of failure of whole database.
• A database will have some kind of backup and recovery
subsystem to recover from any kind of failure.
File system and DBMS
File system DBMS

A file system is a software that manages and DBMS a software application. It is used for
organizes the files in a storage medium. It accessing, creating, and managing databases.
controls how data is stored and retrieved.
The file system provides the details of data DBMS gives an abstract view of data that hides
representation and storage of data. the details
Storing and retrieving of data can't be done DBMS is efficient to use as there are a wide
efficiently in a file system. variety of methods to store and retrieve data.
It does not offer data recovery processes. It has backup recovery for data in DBMS.

In a file management system, the redundancy of The redundancy of data is low in the DBMS
data is greater. system.
Data inconsistency is higher in the file system. Data inconsistency is low in a database
management system.
The file system offers lesser security. Database Management System offers high
security.
There is no efficient query processing in the file You can easily query data in a database using
system. the SQL language.
DBMS Architecture
• DBMS architecture helps in design, development,
implementation, and maintenance of a database.

• A database stores critical information for a business.

• Selecting the correct Database Architecture helps in quick


and secure access to this data.

• The basic client/server architecture is used to deal with


a large number of PCs, web servers, database servers
and other components that are connected with networks.
Types of DBMS Architecture
1-Tier Architecture
• The simplest of Database Architecture are 1-Tier where
the Client, Server, and Database all reside on the same
machine.
• In this architecture, the database is directly available to the user.
• Anytime you install a DB in your system and access it to
practice SQL queries it is 1 tier architecture.

• But such architecture is rarely used in production.

• The 1-Tier architecture is used for development of the


local application, where programmers can directly
communicate with the database for the quick response.

• Example: Standalone Inventory Management System


2-Tier Architecture
• In the two-tier architecture, applications on the client end can
directly communicate with the database at the server side.

• The user interfaces and application programs runs on the client-


side.

• The server side is responsible to provide the functionalities like:


query processing and transaction management.

• An application interface which is called ODBC (Open Database


Connectivity) an API which allows the client-side program to call
the DBMS.

• Ideal for standalone or small applications with limited users.


2-Tier Architecture
3-Tier Architecture
• The 3-Tier architecture contains another layer between the
client and server. which is responsible for communicating
the user's request to the DBMS system and send the
response from the DBMS to the user.

• In this architecture, client can't directly communicate with
the server.

• The application on the client-end interacts with an application


server which further communicates with the database
system.

• End user has no idea about the existence of the database


beyond the application server.
3-Tier Architecture
Data Models and its Categories
• It is the collection of concepts that can be used to
describe the structure of database.
• Structure - datatype, relationship and constraints that should hold
on data.

Categories:
• High-level/Conceptual Data Model
• Low-level/Physical Data Model
• Representational/Implementational Data Model

• Data models help systematically design and implement


a database, ensuring it meets user requirements while
being efficient and maintainable.
High-level/Conceptual Data Model
• It provides the concepts to the way many user perceive
data (Retrieve and obtain data)

• Provides a user-friendly and abstract view of the


database.

• Captures the business requirements and real-world


entities along with their relationships.

• Expresses data in terms of entities, attributes, and


relationships.

• Entity-Relationship (ER) Model.


• Unified Modeling Language (UML) diagrams.
Low-level/Physical Data Model

• It provides the concepts that describes the details of


how data is physically stored and managed.

• Specifies the internal details of data storage, such as file


structures, indexing methods, and access paths.

• Used by database administrators (DBAs) and system


designers to optimize performance.

• Concerned with implementation details like block


storage, buffers, and storage media, data compression
techniques, indexing strategies.
Representational/Implementational Data Model

• It provides the concepts that may be easily understood by


the end user.

• It hides the details of data storage, the way data is


organized in within the computer.
• Acts as a bridge between the conceptual and physical models
and provides a logical view of the data

• Focuses on how data is represented logically in the


database, such as in tables, rows, and columns.
• Includes constraints like primary keys, foreign keys, and data
types.
Schema and Instances
• Schema – the logical structure/description of the
database specified during database design and is not
expected to change frequently.

• Schema Diagram: A diagrammatic display of (some


aspects of) a database.

• Database Instance: The data (content) in the database at


a particular moment in time. Also called database state (or
occurrence).
Database Schema Vs. Database State
• Empty State: When we define new database, we specify it
database scheme only to DBMS. At this point
corresponding database state is empty state with no data.

• Initial Database State: Database when it is loaded with


initial data.

• Current State: Every time update operation is applied, we


get new state of database called current state.

• Valid State: A state that satisfies the structure and


constraints of the database. [Every state must satisfy]

Distinction
• The database schema changes very infrequently. The database
state changes every time the database is updated.
Schema Diagram of Student Database
Three-Schema Architecture
• Proposed to support DBMS characteristics of:
• Program-data independence: to separate the user application and
the physical database
• Multiple views of the data.
Three-Schema Architecture
Defines DBMS schemas at three levels:

Internal Level:
• It has Internal schema
and used to describe
physical storage
structures and access
paths.

• Uses a Physical data


model.
Three-Schema Architecture
Conceptual Level:
• It has Conceptual
schema and used to
describe the structure
and constraints for the
whole database for a
community of users.

• Hides the details of


physical storage
structure of database and
concentrates on
describing entities,
attributes, relationships
and constraints.
• Uses a conceptual data
model.
Three-Schema Architecture
External Level:
• It has number of
External
schemas/External
views

• Each external views


describe the part the
database that a
particular user is
interested in and hides
rest of the database
from that user group.
Three-Schema Architecture
• Mappings among schema levels are needed to transform
requests and reply between various database levels of
architecture.

• External / Conceptual mapping, transform the request


from external level to conceptual schema.

• Conceptual / Internal mapping, transform the request


from the conceptual to internal level.
Data Independence
• Data independence is the capacity to change the schema at
one level of database system without having to change the
schema at the next higher level.

• Logical Data Independence:


• The capacity to change the conceptual schema without having to
change the external schemas and their associated application
programs.
• For example, the conceptual schema may be changed to add some
data item.

• Physical Data Independence:


• The capacity to change the internal schema without having to
change the conceptual schema.
• For example, the internal schema may be changed when certain file
structures are reorganized, or new indexes are created to improve
database performance
DBMS Languages
• When no strict separation of levels is maintained, the
Data Definition Language (DDL) is used to define all
conceptual, internal and external schemas.

• In DBMSs where a clear separation is maintained


between the conceptual and internal levels, the DDL is
used to specify the conceptual schema only.
• To specify the internal schema, the Storage Definition
Language (SDL) is used.

• For a true three-schema architecture, View Definition


Language (VDL) is used to specify the user views.
DBMS Languages
• Data Manipulation Language (DML):

• Used to specify database retrievals and updates.

• DML commands (data sublanguage) can be embedded in a


general-purpose programming language (host language), such as
COBOL, C or an Assembly Language.

• Alternatively, stand-alone DML commands can be applied directly


(query language).

SQL provides all DDL, VDL, SDL and DML


DBMS Interfaces
• Stand-alone query language interfaces
• Example: Entering SQL queries at the DBMS interactive SQL interface

• User-friendly interfaces
• Menu-based (Web-based), popular for browsing on the web
• Forms-based, designed for naïve users used to filling in entries on a
form
• Graphics-based
• Point and Click, Drag and Drop, etc.

• Natural language: requests in written English, free text as a query

• Combinations of the above:


• For example, both menus and forms used extensively in Web database
interfaces
DBMS Interfaces
• Mobile Interfaces: interfaces allowing users to perform
transactions using mobile apps

• Parametric interfaces e.g., bank tellers using function keys.

• Interfaces for the DBA:


• Creating user accounts, granting authorizations
• Setting system parameters
• Changing schemas or access paths
Database Users
• Users may be divided into:

• Actors on the Scene: Person whose jobs involves the


day-to-day use of large database and are actively
interested in database.

• Workers Behind the Scene: Person who are not really


interested in database but works to maintain the
database system.
• Involves in making database system available to the
end-users, they do not use database for own purpose
Actors on the Scene
Database Administrators

• Responsible for authorizing access to the database

• Coordinating and monitoring its use

• Acquiring software and hardware resources

• Deciding the storage structure and data access


strategy.
Actors on the Scene
Database Designers
1. Logical database designer:
• Identifying data (entity, attributes, Constraints and
relationship)
• Communication with varieties of database users to
understand their requirements.

2. Physical database designer


• Mapping the logical database design into set of
tables and integrity constraints.
• Designing any security measures required in the
data
Actors on the Scene
End-users:
• End users are the clients of the databases for whom the database has
been designed and implemented.
• The database primarily exists for their use.

End-users can be categorized into:


• Casual end user:
• Occasionally access when needed. They are typically occasional
browsers.

• Naive or Parametric end user:


• They are unaware of database.
• They access database through specially written application
program/simple commands that makes the operation as simple as
possible. (choosing options from the menu)

• Example: Bank-tellers, Check-out assistant at supermarket,


Actors on the Scene
• Sophisticated end users:
• They are familiar with the structure of database & facilities
offered by dbms. They use high-level query language to
perform the required operations.
• Example: business analysts, scientists, engineers.
• Many use tools in the form of software packages that work
closely with the stored database

• Stand-alone users:
• They maintain personal database by using ready-made
program packages that provide easy-to-use menu or
graphics-based interfaces.

• Example: Maintaining a database of personal photos and


videos.
Actors behind the Scene
• System Analysts and Application Developers
• This category currently accounts for a very large proportion of the
IT work force.
• Implementation of application to access database for required
functionality for the end user (Retrieving, updating, inserting,
deleting data from the database)

• Tool Developer: Design and implements tools.

• Operator and Maintenance personnel: Actual running &


maintenance of hardware and software environment for
the database system.

You might also like