Unit 1 - DBMS1
Unit 1 - DBMS1
Chapter 1 :
INTRODUCTORY
CONCEPTS
File Organization
• is a technique for physically arranging the records of a file on secondary
storage device. A file is organized logically as a sequence of records.
Different File Organization Techniques
1. Sequential file organization
Records in the file are stored in sequence
according to a primary key value.
To locate a particular record, a program
must normally scan the file from the
beginning until the desired record is
located.
Example: Alphabetical list of persons in
the white pages of a telephone directory
Because of inflexibility, sequential files are
not used in a database, but may be used
for files that back up data from a database.
1
Sequential file
organization 2
4
2. Indexed file organization
• Records are stored either sequentially or nonsequentially, and an index is
created that allows the application software to locate individual records.
• An index is a table that is used to determine the location of rows in a file that
satisfy some condition (like a card catalog in a library)
B-tree index
6
3. Hashed file organization
the address of each record is determined using a hashing algorithm.
Hashing algorithm is a routine that converts primary key value into a record
address.
Hashed file or
index
organization
Hash algorithm
Usually uses division-
remainder to determine
record position. Records
with same position are
grouped in lists
Traditional File Processing System
(File-based systems)
File-based systems were an early attempt to computerize the
manual filing system that we are all familiar with
This system is maintained on computers
A collection of application programs that perform services
for the end-users such as the production of reports
In file-based system, each program defines and manages its
own data
This system is faster than manual system
Library Examination Registration
Collection of application programs that perform services for the end users
(e.g. reports). Each program defines and manages its own data.
Example : File system for Bank
Example: suppose a student changed his/ her address. Here there is a possibility that the address is
changed in the student affairs application, but not changed in the academic department. So there
will be two different addresses for the same student and it leads the data to an inconsistent state.
Example : Program A access the Lecturer File in HR department. Because Program A contains a
detailed Lecturer File description, any change to a Lecturer File structurer requires changes to the file
description in Program A. Suppose it is decided to change the Lecturer address field length in this file
from 25 to 30 characters. The file descriptions in program A would have to be modified.
Disadvantages of Traditional File System …
Data Integrity Problems:
•Change in the constraint on data item in a data file need to change in all the
application programs accessing data file.
•Example: Program B and Program C accesses the Student File in Student Affairs department and there is
change in the constraint on the phone field and now, the phone number can start with 9 or 7 digit. The
constraint must be changed in all the programs accessing Student File in Student Affairs department i.e.
Program B and Program C
• Example: assume that a customer is paying for groceries with his/her ATM card and at the same time the
customer‟s salary cheque is being deposited. (The customer‟s bank uses a file processing system):
Database and database systems are an essential encounter in several activities every day that
involve some interaction with a database.
For example,
if we go to bank to deposit or withdraw funds,
if we make a hotel or airline reservation,
if we purchase something online- such as a book, toy or computer
Chances are that our activities will involve someone or some computer program accessing a database.
When data are processed, interpreted, organized, structured, or presented to make them meaningful or useful, they are
called information.
More examples …
1.The history of temperature readings all over the world for the past 100 years is _______
2.If data is organized and analysed to find that global temperature is rising, then that is ________.
3.The number of visitors to a website by country is an example of _____Finding out that traffic from
the Oman is increasing while that from U.A.E is decreasing is ________
Oman University
Data
Information (Summarized data)
• Metadata: are data that describe the properties or
characteristics of end-user data, and the context of
that data.
Name Data Type Length Format Description
Module Varchar 50 Module name
Module Code Varchar 8 Module code
Semester Varchar 10 Semester and
year
Section Char 2 Section
ID Integer 12 xx-xxxxxx Student ID
Name Varchar 60 Fisrtname, Student Name
Secondname,
Thirdname,
Family Name
Specialisation Varchar 25 Student
specialisation
Grade Char 2 Student grade
System Catalog
• contains information such as the structure of each file, the type and
storage format of each data item, and various constraints on the
data. (Metadata which describes the structure of the primary
database)
What is Database?
A database is a shared collection of related data used to support the activities of a particular
organization.
It can be viewed as a repository of data that is defined once and then accessed by various users.
It contain many tables and related data is stored in single table as student data is stored in student table.
All the applications (in various departments) will access the data from database through DBMS.
What is Database Management System (DBMS)?
Collection of programs that enables users to create and maintain databases and control
all access to them.
The goal is to provide an environment that is both convenient and efficient for users to
retrieve and store information.
Users will use the SQL language to communicate with DBMS
Advantages of Database Approach
Program-Data Independence
In the database approach, the data structure (meta data) is stored in the system
catalogue and not in the application programs. Therefore, one change is all that is
needed to change the structure of a file.
Concurrent Access
The DBMS includes concurrency control subsystem 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.
Database Approach
Database
Management
System
University
Students
Database
Components of Database Environment
Components of Database Environment
1. Computer-aided software engineering
(CASE) tools are automated tools used to
design databases and application programs.
• IEF (Information Engineering Facility)
• IEW (Information Engineering Workbench)
• Oracle Designer
2. Repository is a centralized knowledge base
for all data definitions, data relationships,
screen and report formats, and other
system components.
3. DBMS is a software system that is used to
create, maintain, and provide controlled
access to the user databases.
Components of Database Environment
4. Database is an organized collection of logically
related data, usually designed to meet the
information needs of multiple users in an
organization.
5. Application programs are used to create and
maintain the database and provide information to
users.
6. User Interface includes languages, menus, and
other facilities by which users interact with various
system components, such as CASE tools, application
programs, the DBMS and the repository
Components of Database Environment
7. Data and database administrators. Data
administrators are persons who are responsible for
the overall management of data resources in an
organisation. Database administrators are
responsible for physical database design and for
managing technical issues in the database
environment. A database administrator's (DBA)
primary job is to ensure that data is available,
protected from loss and corruption, and easily
accessible as needed.
Components of Database Environment