0% found this document useful (0 votes)
7 views37 pages

Unit 1 - DBMS1

1. The document discusses different file organization techniques used in databases, including sequential, indexed, and hashed file organization. 2. Sequential file organization stores records sequentially by primary key values, requiring a full scan to find a record. Indexed files use a tree index to locate records faster. Hashed files use a hashing algorithm to determine record positions. 3. Traditional file processing systems had disadvantages like data redundancy, program-data dependency, data integrity issues, and concurrent access anomalies. Database systems address these issues through centralized data storage and metadata that describes the database structure.

Uploaded by

Hamodey BBM
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)
7 views37 pages

Unit 1 - DBMS1

1. The document discusses different file organization techniques used in databases, including sequential, indexed, and hashed file organization. 2. Sequential file organization stores records sequentially by primary key values, requiring a full scan to find a record. Indexed files use a tree index to locate records faster. Hashed files use a hashing algorithm to determine record positions. 3. Traditional file processing systems had disadvantages like data redundancy, program-data dependency, data integrity issues, and concurrent access anomalies. Database systems address these issues through centralized data storage and metadata that describes the database structure.

Uploaded by

Hamodey BBM
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/ 37

Data Base Management Systems

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

Records of the If sorted –


every insert or
file are stored delete requires
in sequence by resort
the primary key
field values
If not sorted
Average time to
find desired record
= n/2
n

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

Leaves of the tree


are all at same
level 
consistent access
time

uses a tree search


Average time to find desired
record = depth of the tree

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

Library Examination Registration


Applications Applications Applications

Library Examination Registration


Data Data Data
Files Files Files
 All functional areas in the organization create, processes its own files.

 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

• Each department in the Bank has its own


applications which manage and
manipulate different data files.

• For Banking system, the programs can be


the one to

 debit or credit an account,


 find the balance of an account,
 add a new mortgage loan
 generate monthly statements etc.
Disadvantages of Traditional File System
Data Redundancy:

• Duplication(repeat) of data is called redundancy.


• It creates two (2) other problems which are mentioned below.
I. Unnecessarily huge consumption of storage space.
II. Inconsistency: this state occurs if various copies of the same data have
different values.

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.

Program - Data dependency:


• Change in the data file structures would lead to change in application
programs that access the given file.

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

Concurrent Access Anomalies:


• Allows multiple users to access the same record.
•Typically, in a file-based system, when an application opens a file, that file is
locked. This means that no one else has access to the file at the same time.

• 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.

Database is a centralized and structured set of data stored on a computer system.


Basic components of a Database system

• A database provides facilities for transforming retrieved data into useful


information.

• It is necessary to process the collected data so that it can be stored and


presented in the required usage format
Data vs. Information
Data: Collected facts about a topic or item.

Information: The result of combining, comparing, and performing


calculations on data.

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

Module: Fundamentals of RDBMS Semester: Spring 2009


Module Code: COMP 0301 Section: A
SID Name Specialisation Grade
08-765678 Fatma Sulaiman DBMS A
08-776577 Hamed Said DBMS B+
06-876512 Noora Abdul SFT A-
07-886235 Sultan Humaid CHN C
06-878767 Wafa Khamis SFT B

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

• Is a pre-created tables in database system software which contains all


database information

• 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

Reduced Data Redundancy


In this approach, ideally each data item is stored in only one place in the database.
For example, All the student details exist in only one place (in one file).

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.

Enforcing Integrity Constraints


The DBMS must provide the ability to define and enforce certain constraints to
ensure that users enter valid information and maintain data integrity. A database
constraint is a restriction or rule that dictates what can be entered or edited in a
table such as a postal code using a certain format or adding a valid city in the City
field.

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

Library Examination Registration

Library Examination Registration


Applications Applications Applications

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

9. Systems developers are persons such as systems


analysts and programmers who design new
application programs.

10. End users are persons throughout the organisation


who add, delete, and modify data in the database
and who request or receive information from it.
Data Model
Is a collection of conceptual tools for describing data,
data relationships, data semantics, and consistency
constraints.
Provides a way to describe the design of a database
at the physical, logical and view level.
Data Models can be classified in four categories:
Relational Model
The Entity-Relationship Model
Object-based Data Model
Semistructured Data Model
Categories of Data Model
1. Relational Model
– Uses a collection of tables to represent both data and the relationships
among those data. Each table has multiple columns, and each column
has a unique name.
– Is an example of record-based model.
– Is the most widely used data model, and a vast majority of current
database systems are based on the relational model.
2. Entity-Relationship Model
– Is based on a perception of a real world that consists of collection of
basic objects, called entities, and of relationships among these
objects.
– Is widely used in database design
Example of Relational Model
Example of Entity-Relationship Model

Jeffrey A. Hoffer, V. Ramesh & Heikki Topi. Modern Database Management.


Categories of Data Model
3. Object-based Data Model
– Can be seen as extending the E-R model with notions of
encapsulation, methods (functions), and object identity.
– Combines features of the object-oriented data model and relational
data model.

4. Semistructured Data Model


– Permits the specification of data where individual data items of the
same type may have different sets of attributes.
– The Extensible Markup Language (XML) is widely used to represent
semistructured data.
References:
• Abraham Silberschatz, Henry Korth & S. Sudarshan.
Database System Concepts. 5th ed
• Jeffrey A. Hoffer, V. Ramesh & Heikki Topi. Modern
Database Management. 10th ed.
• Thomas Connolly & Carolyn Begg. Database Solutions
A step-by-step guide to building databases. Second
edition.

You might also like