Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 29

Database Systems

File based system


• With a file based approach each user defines
and creates with a specific software the files
he needs for a specific application.
• File based systems
– Data is stored in files
– Each file has a specific format
– Programs that use these files depend on knowledge about that format

Introduction to Database Systems G51DBS


File Based Systems
• File based systems
– Data is stored in files
– Each file has a specific format
– Programs that use these files
depend on knowledge about
that format
File structures

A file: “STUDENT”
field

ID Last First Grade

3 Smith Jane A
1 Wood Bob C
record
2 Kent Chuck B
4 Boone Dan B
File terms
– Record
• data items related to a single logical entity (e.g. a
student’s information) or row in a table
– Field
• a place for a data item in a record (first name field
in a student record) or a column in a table
– File
• a sequence of records of the same type (the table)
Problems with files
– Redundancy
• number of files grows with applications, and data is duplicated

– Inconsistency
• data is updated in one application’s files, but not in another’s

– Maintenance problems
• changes to data structures mean changes to many programs

– Difficulty combining data


• business needs may mean users want data from different applications

Introduction to Database Systems G51DBS


What is a Database?
• A database may be defined as a collection of
interrelated data stored together without any
harmful redundancy to serve multiple
application. The data stored in database is
independent from any application program
that use it. There is common & controlled
approach for creating, modifying & retrieving
data in database.
Databases
• Web indexes • Train timetables
• Library catalogues • Airline bookings
• Medical records • Credit card details
• Bank accounts • Student records
• Stock control • Customer histories
• Personnel systems • Stock market prices
• Product catalogues • Discussion boards
• Telephone directories • and so on…
Database Systems
• A database system consists • Database systems allow
of users to
– Data (the database) – Store
– Software – Update
– Hardware – Retrieve
– Users – Organise
– Procedures – Protect
their data.
DBMS components
• Hardware
– The physical computer system that allows physical access to
data
• Software(DBMS)
– The actual program that allows users to access, maintain, and
update physical data
• Data: stored physically on the storage devices
• User: include end users, application programs and DBA
• Procedure
– A set of procedures (rules) that should be clearly defined and
followed by the users of the database
Data base management system
• A DBMS is a software that allows creation,
definition and manipulation of database. It is
actually a tool used to perform any kind of
operation on data in database. DBMS also
provides protection and security to database. It
maintains data consistency in case of multiple
users. Here are some examples of popular
dbms :MySql, Oracle, Sybase, Microsoft
Access and IBM DB2 etc.
Introduction to Database Systems G51DBS
Functions of DBMS

• Provides data Independence


• Concurrency Control
• Provides Recovery services
• Provides Utility services
• Provides a clear and logical view of the
process that manipulates data.

Introduction to Database Systems G51DBS


What the DBMS does
• Provides users with • DBMS provides
– Data definition language – Persistence
(DDL) – Concurrency
– Data manipulation language – Integrity
(DML) – Security
– Data control language (DCL) – Data independence
• Often these are all the same • Data Dictionary
language – Describes the database itself
Data Dictionary - Metadata
• The dictionary or catalog • The dictionary holds
stores information about – Descriptions of database
the database itself objects (tables, users, rules,
views, indexes,…)
• This is data about data or
– Information about who is
‘metadata’ using which data (locks)
• Almost every aspect of the – Schemas and mappings
DBMS uses the dictionary
Database Users
• End users • Database Administrator
– Use the database system to (DBA)
achieve some goal – Designs & manages the
• Application developers database system
– Write software to allow end
users to interface with the
database system
Database Administrator (DBA)

• Administrators maintain the DBMS and are


responsible for administrating the database.
They are responsible to look after its usage
and by whom it should be used. They create
access profiles for users and apply limitations
to maintain isolation and force security.
Administrators also look after DBMS resources
like system license, required tools, and other
software and hardware related maintenance.
Introduction to Database Systems G51DBS
Responsibilities of DBA
– Design logical/physical schemas
– Handle security and authorization
– Deciding the backup & recovery methods.
– Define integrity constraints.
– Monitoring the performance and
responding to the changing requirements.

Introduction to Database Systems G51DBS


Database Schema

• A database schema is the skeleton structure


that represents the logical view of the entire
database. It defines how the data is organized
and how the relations among them are
associated. It formulates all the constraints
that are to be applied on the data. It contains
a descriptive detail of the database, which can
be depicted by means of schema diagrams.

Introduction to Database Systems G51DBS


Two Categories of database schema −

• Physical Database Schema − This schema


pertains to the actual storage of data and its
form of storage like files, indices, etc. It defines
how the data will be stored in a secondary
storage.
• Logical Database Schema − This schema
defines all the logical constraints that need to
be applied on the data stored. It defines tables,
views, and integrity constraints.
Introduction to Database Systems G51DBS
Introduction to Database Systems G51DBS
Database Instance

• A database instance is a state of operational


database with data at any given time. It
contains a snapshot of the database. Database
instances tend to change with time. A DBMS
ensures that its every instance (state) is in a
valid state, by diligently following all the
validations, constraints, and conditions that
the database designers have imposed

Introduction to Database Systems G51DBS


Data Independence
• Applications insulated from
how data is structured and View 1 View 2 View 3
stored.
• Logical data independence: Conceptual Schema
Protection from changes in
logical structure of data. Physical Schema
• Physical data
independence: Protection
DB
from changes in physical
structure of data.
Database Architecture
• A three-level architecture
– Internal level: For systems designers
– Conceptual level: For database designers and administrators
– External level: For database users
Database
architecture
Internal Level
• Deals with physical storage
of data
– Structure of records on disk -
files, pages, blocks
– Indexes and ordering of
records
– Used by database system
programmers
Conceptual Level
• Deals with the organisation
of the data as a whole
– Abstractions are used to
remove unnecessary details
of the internal level
– Used by DBAs and application
programmers
External Level
• Provides a view of the
database tailored to a user
– Parts of the data may be
hidden
– Data is presented in a useful
form
– Used by end users and
application programmers
Mappings
• Mappings translate • Physical data independence
information from one level – Changes to internal level
to the next shouldn’t affect conceptual
– External/Conceptual level
– Conceptual/Internal • Logical data independence
• These mappings provide – Conceptual level changes
shouldn’t affect external
data independence levels
Architecture

User 1 User 2 User 3

External External
External Schemas
View 1 View 2

External/Conceptual Mappings
Conceptual DBA
Conceptual Schema View

Conceptual/Internal Mapping

Internal Schema Stored


Data

You might also like