DATABASE CONCEPT
Database can be defined as a collection
of information organized in such a way that
it can be accessed ea...
Database Terminologies
 Data
This is the fact, or about specific entity(person,place or thing)
 Information
Is the data ...
USER
FILE KEEPER
FILE CABINET
MANUAL FILE SYSTEM
FILE PROCESSING SYSTEM
Information stored as group of records in
separate files
File systems consisted of a few data fil...
File processing systems structure
Customer fileCustomer file
User 1
Rental fileRental file
User 2
Customer
Processing
Appl...
Limitation of File Processing system
i. Separate and isolated data
To make decision, user might need data from more
than o...
iv. Difficult in representing data from user’s view
To create useful application for user, often data
from various files m...
DATA BASE MANAGEMENT
SYSTEM(DBMS)
 Is a program that allows users to define, create, manipulate,
store, maintain retrieve...
DBMS STRUCTURE
USER 1USER 1
USER 2USER 2
USER 3USER 3
RPARPA
OPAOPA
DBMSDBMS
DATABASEDATABASE
CPA
CHARACTERISTICS OF DMS
i. Computerized record keeping system
ii. Contain facilities that allow user to:
(a)add, and delete...
EXAMPLES OF DBMS
Ms ACCESS
SQL SERVER
ORACLE
MY SQL
FUNCTIONS OF DBMS
To store data
To organize data
To control access to data
To protect data
USES OF DBMS
To provide decision support
To provide transaction processing
COMPONENTS OF DBMS
The basic components of a DBMS can be
divided into three subsystem
i. Design tool
This provide features...
ADVANTAGES OF DBMS
i. Centralized data reduce management
problems
ii. Data redundancy and consistency are
controllable
iii...
DISADVANTAGES OF DBMS
i. Reduction in speed of data access time
ii. Require special knowledge
iii. Possible dependency of ...
DATABASE ADMINISTRTATOR
Is a one who controls and manage the data
base
Functions of DBMS
To make decisions concerns the ...
FLAT DATABASE MODEL
The earliest and simplest database model
Is a way of organizing information in a
single table
Is go...
HIERARCHICAL DATABASE
MODEL
As its name implies, the hierarchical database
model defines hierarchically arrangement of da...
Parents and children are tied together by links
called “pointers”
More efficient than Flat database
Has some serious pr...
NETWORK DATABASE
MODEL
 It was designed to solve problems of hierarchical
data base model
 It solves the problem of data...
RELATIONAL DATABASE MODEL
 Is a collection of data items organized as a set of
formally-describes tables from which data ...
Each table is made up of records (horizontal
rows also known as tuples) and fields
(vertical column also known as attribu...
Null values-is a missing or unknown value in
a column of a table, null are not the same as
zeros
Primary key-is the colu...
DATABASE DEVELOPMENT
The process can be broken into 5 phases
(i)Planning
(ii)Analysis
(iii)Design
(iv)Implementation
(v)M...
PLANING PHASE
Here the overall database structure is defined.
It involves the following tasks
1. The purpose of database...
Analysis phase
Database can be analyzed on different models:
i. Conceptual model
ii. Logical model
iii. Physical model
Con...
Entities
This defines a thing that exist and is
distinguishable from which data will be
collected, e.g person,place or ob...
Relationship
A relationship is a connection between entity classes.
Example, relationship between PERSONS
and AUTOMOBILES...
Logical model
This is done after conceptual model
Tables and fields are extracted
Entities modeled as tables
Attributes...
DESIGN PHASE
This determines how best the information system
that was obtained
The following should be determined and
and ...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 32
Database Management Systems
(DBMS)
Aiwinia Temba
Computing and Information Tech...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 33
Course Co-ordinator
Aiwinia Temba
tembaaiwinia@gmail.com
Address:Boma Road Oppo...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 34
An Integrated of :-
• Introduction
– Fundamentals of database
– File Processing...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 35
Recommended Readings
• Leon, A. and Leon,M (2002) Database Management
Systems,D...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 36
Outline
–Fundamentals of Database
–File Processing
–Advantages & Disadvantages ...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 37
Fundamentals of Database
• Computer uses databases by using a set of well defin...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 38
Fundamentals of Database…….
Figure 1 Illustrates the concepts of Fields, Record...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 39
Fundamentals of Database…….
• Field
– The smallest piece of meaningful informat...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 40
Fundamentals of Database…….
• Record
– Collection of related fields
– Example, ...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 41
Fundamentals of Database…….
Figure 2 illustrates the concepts of Fields, Record...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 42
Fundamentals of Database…….
• Database
– Database is a collection of related fi...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 43
Fundamentals of Database…….
• Key Field
– The Keyfield in a record is a unique ...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 44
File Processing
• Data, Information, Knowledge
May 23, 2014 AT(CIT, Kili Com.net) DBMS 45
File Processing……….
• Data
– Are raw facts which can be manipulated
– Data is r...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 46
File Processing……….
• Information………..
– It is the indispensable link that ties...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 47
File Processing……….
• Information…….
– It involves the communication and recipi...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 48
File Processing……….
• Information……..
– Notice that the data that is being proc...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 49
File Processing……….
Figure 3, Information Cycle
May 23, 2014 AT(CIT, Kili Com.net) DBMS 50
File Processing……….
• Information Processing
– Information processing is the ac...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 51
File Processing……….
• Files, File organisation and Management
• File
– A file i...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 52
File Processing……….
• File…..
– It contains data that is needed for information...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 53
File Processing……….
• File……..
– The values of the attributes describe a partic...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 54
File Processing……….
• File………..
– In data storage, data items are usually group...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 55
File Processing……….
• Master files
– A file of relatively permanent information...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 56
File Processing……….
• Transaction Files
– A collection of records describing ac...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 57
File Processing……….
• Report Files
– A file created by extracting data to prepa...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 58
File Processing……….
• Operations on Files
– There are mainly two kinds of file ...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 59
File Processing……….
• Operations on Files……
– The following five operations are...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 60
File Processing……….
• File Organisation
– A technique for physically arranging ...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 61
File Processing……….
• File organisation…..
– Two types of file organisation are...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 62
File Processing……….
• Sequential file organisation….
– A primary key is a field...
May 23, 2014 AS(CIT, IFM) DBMS 63
File Processing……….
• Sequential file organisation….
– Records must be processed and acc...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 64
File Processing……….
• Advantages of Sequential file processing
– It uses magnet...
May 23, 2014 AT(CIT, Kili Com.net) DBMS 65
File Processing……….
• Disadvantages ..
– Time factor –the time it takes to acce...
05/23/14 DBMS AT(CIT, Kili Com.net) 66
File Processing……….
• Advantages of Sequential file processing
– It uses magnetic t...
05/23/14 DBMS AT(CIT, Kili Com.net) 67
File Processing……….
• Disadvantages ..
– Time factor –the time it takes to access a...
05/23/14 DBMS AT(CIT, Kili Com.net) 68
File Processing……….
• Direct File Organisation
– The data can be organised in such ...
05/23/14 DBMS AT(CIT, Kili Com.net) 69
File Processing……….
• Direct processing requires either magnetic disk or
optical di...
05/23/14 DBMS AT(CIT, Kili Com.net) 70
File Processing……….
Figure 4, Direct File Processing –Records are accessed directly
05/23/14 DBMS AT(CIT, Kili Com.net) 71
File Processing……….
• Direct file processing….
– There are several strategies which...
05/23/14 DBMS AT(CIT, Kili Com.net) 72
File Processing……….
• Relative addressing….
– Relative addressing loses its appeal ...
05/23/14 DBMS AT(CIT, Kili Com.net) 73
File Processing……….
– The task of this process is to take a set of records keys and...
05/23/14 DBMS AT(CIT, Kili Com.net) 74
File Processing……….
• Indexing
– It uses a primary index which associates a primary...
05/23/14 DBMS AS(CIT,IFM) 75
File Processing……….
• Disadvantages of direct file processing
– The use of an index lowers th...
05/23/14 DBMS AT(CIT, Kili Com.net) 76
File Processing……….
• Summary on direct file organisation
– The choice of file orga...
05/23/14 DBMS AT(CIT, Kili Com.net) 77
Data Processing
• Data processing comprises the following;
– Capturing of data
– St...
05/23/14 DBMS AT(CIT, Kili Com.net) 78
Data Management..
• Data management involves the following,
– Data administration
–...
05/23/14 DBMS AT(CIT, Kili Com.net) 79
Data Independence
• Data Independence
– Data independence allows a database to be
s...
05/23/14 DBMS AT(CIT, Kili Com.net) 80
Data Independence….
• There are two distinct levels of data
independence;
– Logical...
05/23/14 DBMS AT(CIT, Kili Com.net) 81
Data independence….
• Physical data independence
– Indicates that the physical stor...
05/23/14 DBMS AT(CIT, Kili Com.net) 82
Database Administration Roles
• Database administration –Centrally
controlling the ...
05/23/14 DBMS AT(CIT, Kili Com.net) 83
Database Administration Roles..
• Implementing Security Features,
– DBA maintains t...
05/23/14 DBMS AT(CIT, Kili Com.net) 84
Database Administration Roles…
• Measures Against Data Loss
– DBA is responsible fo...
05/23/14 DBMS AT(CIT, Kili Com.net) 85
Database Administration Roles…
• DBMS Users…..
– The user can be classified as..
• ...
05/23/14 DBMS AT(CIT, Kili Com.net) 86
Database Administration Roles…
• Naïve Users…
– The user is instructed through each...
05/23/14 DBMS AT(CIT, Kili Com.net) 87
Database Administration Roles…
• Online Users
– Are those users who may communicate...
05/23/14 DBMS AT(CIT, Kili Com.net) 88
Database Administration Roles…
• Application programmers
– Professional programmers...
05/23/14 DBMS AT(CIT, Kili Com.net) 89
Data Dictionary• A Data Dictionary is a database about databases, it holds the
foll...
05/23/14 DBMS AT(CIT, Kili Com.net) 90
Data Dictionary…..
• Importance of Data Dictionary
– It provides the name of a data...
05/23/14 DBMS AT(CIT, Kili Com.net) 91
Database Processing
Figure 1, Components of a Database
05/23/14 DBMS AT(CIT, Kili Com.net) 92
Database processing…..
• What is a Database?
– A collection of data designed to be ...
05/23/14 DBMS AT(CIT, Kili Com.net) 93
Database Processing….
– Example, some applications make a distinction
between data ...
05/23/14 DBMS AT(CIT, Kili Com.net) 94
Database processing…..
• Relationships
– Relationships represent a correspondence b...
05/23/14 DBMS AT(CIT, Kili Com.net) 95
Database processing…..
• Schema…
– It separates the physical aspects of data storag...
05/23/14 DBMS AT(CIT, Kili Com.net) 96
Database processing…..
Figure 2, Organisation of a Database
05/23/14 DBMS AT(CIT, Kili Com.net) 97
Database processing…..
• Why a Database
– Why should an organisation have an integr...
05/23/14 DBMS AT(CIT, Kili Com.net) 98
Database processing…..
• The advantage of having the data in a database are;
– Redu...
05/23/14 DBMS AT(CIT, Kili Com.net) 99
Database processing…..
– Integrity can be maintained –integrity means
that the data...
05/23/14 DBMS AT(CIT, Kili Com.net) 100
Database processing…..
• Characteristics of Data in a Database
– Shared –a data in...
05/23/14 DBMS AT(CIT, Kili Com.net) 101
Types of Database Language
• There are three types of database languages
– DDL ( D...
05/23/14 DBMS AT(CIT, Kili Com.net) 102
Types of Database Language…
• DDL
– Used to define data and their relationships to...
05/23/14 DBMS AT(CIT, Kili Com.net) 103
Data Definition Language…
– It allows specification of following information
about...
05/23/14 DBMS AT(CIT, Kili Com.net) 104
Types of Database
Language……
• DML
– DML is a language which deals with the proces...
05/23/14 DBMS AT(CIT, Kili Com.net) 105
Types of Database
Language……
• DCL
– DCL is a language which used to improve secur...
05/23/14 DBMS AT(CIT, Kili Com.net) 106
Database Management Systems
(DBMS)
• Outline
– Introduction to DBMS
– Database Arc...
About the Author
My name is Aiwinia Temba. I grew up in Kilimanjaro until I was 25 and
then I moved down to Moshi, Marangu...
Upcoming SlideShare
Loading in...5
×

Database concept

927

Published on

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
927
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
59
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "Database concept"

  1. 1. DATABASE CONCEPT Database can be defined as a collection of information organized in such a way that it can be accessed easily. Examples of database: i. Telephone directory ii. Tracking customer orders iii. Maintain employees records.
  2. 2. Database Terminologies  Data This is the fact, or about specific entity(person,place or thing)  Information Is the data that have been processed and is useful to the user  Field Is a single item of information or data in entity e.g. employee name  Record Is a group of fields about an entity,example Employee’s particulars
  3. 3. USER FILE KEEPER FILE CABINET MANUAL FILE SYSTEM
  4. 4. FILE PROCESSING SYSTEM Information stored as group of records in separate files File systems consisted of a few data files and many application programs Each file called a soft file Flat file contained the processed information for one specific function Use of programming languages to write applications
  5. 5. File processing systems structure Customer fileCustomer file User 1 Rental fileRental file User 2 Customer Processing Application Customer Processing Application Rental Processing Application Rental Processing Application Rental fileRental file Customer file
  6. 6. Limitation of File Processing system i. Separate and isolated data To make decision, user might need data from more than one file ii. Data redundancy often the same information was stored in more than one file, in addition to taking up more space in the system, this cause loss of data integrity iii. Program data independence for file formats and access techniques
  7. 7. iv. Difficult in representing data from user’s view To create useful application for user, often data from various files must be combined. In file processing system, it was difficult to determine the relationship between isolated data in order to meet user requirement. v. Data inflexibility Program-data independency and data isolation limited the flexibility of the file processing system in providing user requirement Due to this limitations, the concept of Data base management system (DBMS) was born
  8. 8. DATA BASE MANAGEMENT SYSTEM(DBMS)  Is a program that allows users to define, create, manipulate, store, maintain retrieve and process the data in the data base in order to produce meaningful information.  Focus on information presentation  Data stored as a records in various database files that can be combined to produce meaningful information for users  It controls all functions of capturing, processing, storing, retrieving data and generates various forms of data output  Manage access by multiple users and multiple programs to common stored data.  And hence it overcomes all limitations of FPS
  9. 9. DBMS STRUCTURE USER 1USER 1 USER 2USER 2 USER 3USER 3 RPARPA OPAOPA DBMSDBMS DATABASEDATABASE CPA
  10. 10. CHARACTERISTICS OF DMS i. Computerized record keeping system ii. Contain facilities that allow user to: (a)add, and delete files (b)Insert,retrieve, update, delete data iii. Collection of databases; each can be used for separate purposes or combined
  11. 11. EXAMPLES OF DBMS Ms ACCESS SQL SERVER ORACLE MY SQL
  12. 12. FUNCTIONS OF DBMS To store data To organize data To control access to data To protect data
  13. 13. USES OF DBMS To provide decision support To provide transaction processing
  14. 14. COMPONENTS OF DBMS The basic components of a DBMS can be divided into three subsystem i. Design tool This provide features for creating the data base and various application, forms, and reports ii. Run-time facilities This process the application created by design tools. iii. DBMS engine Translates between the design tools and run time facilities and data
  15. 15. ADVANTAGES OF DBMS i. Centralized data reduce management problems ii. Data redundancy and consistency are controllable iii. Program-data interdependence is diminished iv. Flexibility of data is increased
  16. 16. DISADVANTAGES OF DBMS i. Reduction in speed of data access time ii. Require special knowledge iii. Possible dependency of application programs to specific DBMS versions
  17. 17. DATABASE ADMINISTRTATOR Is a one who controls and manage the data base Functions of DBMS To make decisions concerns the content of the data base Plan storage strictures and access strategies. Provide user support To define security and integrity checks Interpret backup and recovery strategies
  18. 18. FLAT DATABASE MODEL The earliest and simplest database model Is a way of organizing information in a single table Is good only for simple database Possible redundancy of data
  19. 19. HIERARCHICAL DATABASE MODEL As its name implies, the hierarchical database model defines hierarchically arrangement of data Is like upside down tree A single table acts as a root of the database from which the other table branches out Relationship in such system are thought of in terms of children an parents, such as a children may have only one parent but a parent can have multiple children
  20. 20. Parents and children are tied together by links called “pointers” More efficient than Flat database Has some serious problems, that you can not add a record to a child table until it has already been incorporated with the parent Redundancy of data may occur because it does not handle many to may relationship
  21. 21. NETWORK DATABASE MODEL  It was designed to solve problems of hierarchical data base model  It solves the problem of data redundancy by representing relationship in terms of sets rather than hierarchy  It is similar to the hierarchical model, in fact the hierarchy model is a subset of network model  But this model was difficult to implement, so another simple model was developed, which is RELATIONAL DATABASE MODEL
  22. 22. RELATIONAL DATABASE MODEL  Is a collection of data items organized as a set of formally-describes tables from which data can be accessed or reassembled in many different ways without having to reorganize the data base tables  A collection of data organized in two-dimensional tables consisting of named columns and rows  It is easy to create  It is easy to extend, after original database creation.  The core of Relational data base model is the concept of table, which is also called relation in which all data is stored
  23. 23. Each table is made up of records (horizontal rows also known as tuples) and fields (vertical column also known as attributes) Table-is a two dimensional representation of data consisting of column and zero or more rows* The table name must be unique The table name must be descriptive Column name must be unique within the table, however those columns in different tables my share the same name Rows must be unique
  24. 24. Null values-is a missing or unknown value in a column of a table, null are not the same as zeros Primary key-is the column or group of columns whose values uniquely identify each row of a table Every table must have only one PK Pk must always have a value PK must be unique Foreign key is a column or group of columns that is a primary key in another table, it relates the rows of the table to other rows that appear elsewhere in another table
  25. 25. DATABASE DEVELOPMENT The process can be broken into 5 phases (i)Planning (ii)Analysis (iii)Design (iv)Implementation (v)Maintenance These phases often overlap, and some techniques and tools may be used in more than one stage, especially between analysis and design. E.g Data Dictionary Data base design is non deterministic
  26. 26. PLANING PHASE Here the overall database structure is defined. It involves the following tasks 1. The purpose of database is determined What information will be used How information is to be use What question will be answered 2. Feasibility study are conducted 3. Requirements are gathered
  27. 27. Analysis phase Database can be analyzed on different models: i. Conceptual model ii. Logical model iii. Physical model Conceptual model  It provide the framework for developing a database structure schema from top to down  Three data base components (entities,attributes an relationship) are described in detail.
  28. 28. Entities This defines a thing that exist and is distinguishable from which data will be collected, e.g person,place or object. These are are basic building blocks of database Entity instance Is a particular occurrence of an entity Entity set/class/type A group of similar entities Attributes This describes the properties of entities and relationship
  29. 29. Relationship A relationship is a connection between entity classes. Example, relationship between PERSONS and AUTOMOBILES could be an “OWNS” That is to say , people own automobile Types of relationship We have three types of relationship 1.one-to-one 2. One-to-may 3.Many-to-many Candidate keys
  30. 30. Logical model This is done after conceptual model Tables and fields are extracted Entities modeled as tables Attributes modeled as fields Each entity instance is called a record. PK and FK are determined After that Normalization process takes place Physical model This defines how data will be stored and accessed in a computer system
  31. 31. DESIGN PHASE This determines how best the information system that was obtained The following should be determined and and represented in design phase Tables needed Fields needed for each table Relationships between tables DBMS User views (Input forms, output reports) Security mechanism
  32. 32. May 23, 2014 AT(CIT, Kili Com.net) DBMS 32 Database Management Systems (DBMS) Aiwinia Temba Computing and Information Technology Dept. Kili Com.net & Aiwindory.inc
  33. 33. May 23, 2014 AT(CIT, Kili Com.net) DBMS 33 Course Co-ordinator Aiwinia Temba tembaaiwinia@gmail.com Address:Boma Road Opposite Immigration Office,Address:Boma Road Opposite Immigration Office, P.O BOX 7797 Moshi -Tanzania Website: www.kilicom.net Consultation Hours Monday & Friday 09:00 AM-16:00PM
  34. 34. May 23, 2014 AT(CIT, Kili Com.net) DBMS 34 An Integrated of :- • Introduction – Fundamentals of database – File Processing • Database processing • Common database software • Database Management Systems (DBMS) • Relational Database Management Systems (RDBMS) • Data Normalization • Introduction to Structured Query Language (SQL) • Implementation of a Relational Database using a RDBMS
  35. 35. May 23, 2014 AT(CIT, Kili Com.net) DBMS 35 Recommended Readings • Leon, A. and Leon,M (2002) Database Management Systems,Dar es Salaam University Press • Narang, Rajesh (2004) Database Management Systems, New Delhi • David Kroenke (2002), Database Processing: Fundamentals, Design and Implementation, 8th Edition, Prentice Hall, Upper Saddle River NJ • Thomas M. Connolly and Carolyn E. Begg (2002), Database Systems: A Practical Approach to Design, Implementation, and Management, 3rd Edition, Addison- Wesley, Harlow England. – Note, Additional Readings shall be provided if necessary.
  36. 36. May 23, 2014 AT(CIT, Kili Com.net) DBMS 36 Outline –Fundamentals of Database –File Processing –Advantages & Disadvantages of File Process Approach –Data Processing –Data Management –Data Independence –Data Administration Roles
  37. 37. May 23, 2014 AT(CIT, Kili Com.net) DBMS 37 Fundamentals of Database • Computer uses databases by using a set of well defined rules. • Example, Assume that each card in the mailbox has five lines of data items, namely as:- – Name, Locality, City, State and Pin_Code – These fields combined to form a record. – Generally, A database contains the following. • Field • Record • File • Database • Key Field
  38. 38. May 23, 2014 AT(CIT, Kili Com.net) DBMS 38 Fundamentals of Database……. Figure 1 Illustrates the concepts of Fields, Records, and Files
  39. 39. May 23, 2014 AT(CIT, Kili Com.net) DBMS 39 Fundamentals of Database……. • Field – The smallest piece of meaningful information in a file is called a data item or Field. – A data item is generally used for a group of alphanumeric characters. – Example, Name, Locality, City, State, Pin_Code are all known as Data Items or Fields as shown in figure 1
  40. 40. May 23, 2014 AT(CIT, Kili Com.net) DBMS 40 Fundamentals of Database……. • Record – Collection of related fields – Example, Figure 1 contains four records and each record has five related fields namely as • Name, Locality, City, State and Pin_Code • File – Is the Collection of all related records. – Example, in figure 1, the file contains the list of addresses of four friends.
  41. 41. May 23, 2014 AT(CIT, Kili Com.net) DBMS 41 Fundamentals of Database……. Figure 2 illustrates the concepts of Fields, Records, Files and Database
  42. 42. May 23, 2014 AT(CIT, Kili Com.net) DBMS 42 Fundamentals of Database……. • Database – Database is a collection of related files. – A database is an organised collection of facts – Is a Collection of information arranged and presented to serve an assigned purpose – Examples- • A dictionary, where words are arranged alphabetically • Telephone directory where subscriber names are listed in alphabetic order. • Figure 2 shows Employees Database having related files containing records of employees
  43. 43. May 23, 2014 AT(CIT, Kili Com.net) DBMS 43 Fundamentals of Database……. • Key Field – The Keyfield in a record is a unique data item which is used to identify the record for the purpose of accessing and manipulating database – In figure 2, • File 1 contains employee records with fields Emp_Code and Address, • File 2 contains employee records with fields Emp_Code and Salary • File 3 contains employee records with fields Emp_Code and Name • All the three files have one common field, namely Emp_Code, this field is called the Keyfield – Is used for identifying and relating records
  44. 44. May 23, 2014 AT(CIT, Kili Com.net) DBMS 44 File Processing • Data, Information, Knowledge
  45. 45. May 23, 2014 AT(CIT, Kili Com.net) DBMS 45 File Processing………. • Data – Are raw facts which can be manipulated – Data is required in the operation of any organisation and the same or similar data may be required for various purposes • Information – The manipulation of data, simply information is summarization of data in presentable form – Data consists of facts which become information when they are processed and convey meaning to people. – Information is the backbone of any organisation – Information is the critical factor that enables managers and organisations to gain a competitive advantage. It can be considered as the most critical resource of an organisation.
  46. 46. May 23, 2014 AT(CIT, Kili Com.net) DBMS 46 File Processing………. • Information……….. – It is the indispensable link that ties together all the components of an organisation for better operation and coordination and for survival in today’s brutally competitive environment. Definition, Information is ‘data that have been put into a meaningful and useful context and communicated to a recipient who uses it to make decision’ (Burch and Grudnitski,1989)
  47. 47. May 23, 2014 AT(CIT, Kili Com.net) DBMS 47 File Processing………. • Information……. – It involves the communication and recipient of intelligence or knowledge – It should predict the future with reasonable level of accuracy – It should help the managers make the best decision and a prevent them from taking wrong decision – It consists of data , images , text , documents and voice often inextricably intertwined but always organised in a meaningful context.
  48. 48. May 23, 2014 AT(CIT, Kili Com.net) DBMS 48 File Processing………. • Information…….. – Notice that the data that is being processed or refined can be input, stored or both and this formulates the cycle of information, refer figure 3. – Example, If orders and payments are data, then balance_due and quantity_in_hand would be the information • Knowledge – Refers to as the facts , events and inference rules used by a computer program in order to operate intelligently. – It refers to a person’s capability and wisdom as how much that person knows about one particular subject
  49. 49. May 23, 2014 AT(CIT, Kili Com.net) DBMS 49 File Processing………. Figure 3, Information Cycle
  50. 50. May 23, 2014 AT(CIT, Kili Com.net) DBMS 50 File Processing………. • Information Processing – Information processing is the acquisition, storage, organisation retrieval, display and dissemination of information – Quality information means that the information that is – Accurate – Timely – Relevant
  51. 51. May 23, 2014 AT(CIT, Kili Com.net) DBMS 51 File Processing………. • Files, File organisation and Management • File – A file is a collection of bytes stored as an individual entity – All data on disk is stored as a file with an assigned file name that is unique within the directory it resides it. – To the computer, a file is the series of bytes – The structure of a file is known to the software that manipulate it.
  52. 52. May 23, 2014 AT(CIT, Kili Com.net) DBMS 52 File Processing………. • File….. – It contains data that is needed for information processing – These data is called entities, An entity is anything about which information can be stored, examples, physical object, a person, concept or event and so on – An attribute is a characteristic of interest about an entity.
  53. 53. May 23, 2014 AT(CIT, Kili Com.net) DBMS 53 File Processing………. • File…….. – The values of the attributes describe a particular entity. – An Instance of the entity is represented by a set of specific values for each of the attributes Examples, Entity – a boda boda Attributes (boda) –Make, Model, Price, Eng. Capacity Instances (boda) –Boda boda, Tsh1000000, £12,000,
  54. 54. May 23, 2014 AT(CIT, Kili Com.net) DBMS 54 File Processing………. • File……….. – In data storage, data items are usually grouped together to describe an entity • There are different types of files, – Master files – Transaction files – Report files
  55. 55. May 23, 2014 AT(CIT, Kili Com.net) DBMS 55 File Processing………. • Master files – A file of relatively permanent information about entities – These files are used as a source of reference data for processing transactions and accumulated information based on the transaction data. – Example, the accounts master file in a bank will contain details like account name, balance, address and so on
  56. 56. May 23, 2014 AT(CIT, Kili Com.net) DBMS 56 File Processing………. • Transaction Files – A collection of records describing activities or transactions by organisation. – Created as a result of transactions and preparing transaction documents – Are used to update the details in the master file – Example in the same bank system, the day-to- day activities like money withdrawals, deposits and transfers.
  57. 57. May 23, 2014 AT(CIT, Kili Com.net) DBMS 57 File Processing………. • Report Files – A file created by extracting data to prepare a report – Example, All accounts sorted by account number containing the details like account name, balance and so on
  58. 58. May 23, 2014 AT(CIT, Kili Com.net) DBMS 58 File Processing………. • Operations on Files – There are mainly two kinds of file operations • Retrieval and • Update operations – Retrieval operations do not change the contents of the file thus it only locates records in the file matching certain specific criteria – Update operations change the contents of the file by modifying the records, deleting (delete) the records and inserting (Insert) new records
  59. 59. May 23, 2014 AT(CIT, Kili Com.net) DBMS 59 File Processing………. • Operations on Files…… – The following five operations are required for the processing of records in files • File creation • Records location • Record creation • Record deletion • Record modification
  60. 60. May 23, 2014 AT(CIT, Kili Com.net) DBMS 60 File Processing………. • File Organisation – A technique for physically arranging the records of a file on secondary storage devices – Factors necessary to be considered when choosing the file organisation • Speed of data retrieval • Speed of processing data • Speed of update operations • Storage space • Security
  61. 61. May 23, 2014 AT(CIT, Kili Com.net) DBMS 61 File Processing………. • File organisation….. – Two types of file organisation are • Sequential file organisation and • Direct file organisation – Sequential file organisation • Records are stored in some predetermined sequence one after the other • It contains one field referred to as Primary Key • Primary Key usually determines their sequence or order
  62. 62. May 23, 2014 AT(CIT, Kili Com.net) DBMS 62 File Processing………. • Sequential file organisation…. – A primary key is a field ( or set of fields) whose contents is unique to one record and can therefore be used to identify that record. – Example, Student_ID, Customer_ID, Emp_ID and so on – Sequential file organisation is very common because it makes effective use of the least expensive secondary storage device –the magnetic tape
  63. 63. May 23, 2014 AS(CIT, IFM) DBMS 63 File Processing………. • Sequential file organisation…. – Records must be processed and accessed sequentially – It means when using sequential access to reach a particular record, all records preceding it most first be processed – Efficient when the entire file or an appreciable portion of the file must be processed together – Processing data using sequential access referred to as sequential file processing
  64. 64. May 23, 2014 AT(CIT, Kili Com.net) DBMS 64 File Processing………. • Advantages of Sequential file processing – It uses magnetic tape, the least expensive method of secondary storage. – It is the most efficient form of organisation when the entire of file or most of it is processed at once – Transaction file and old master file together act as a back-up, it can be used to create the new master file when existing one damaged or destroyed
  65. 65. May 23, 2014 AT(CIT, Kili Com.net) DBMS 65 File Processing………. • Disadvantages .. – Time factor –the time it takes to access a particular record may be too long for many applications – The entire file most be accessed and a new master file created , even if only one record requires maintenance or updating.
  66. 66. 05/23/14 DBMS AT(CIT, Kili Com.net) 66 File Processing………. • Advantages of Sequential file processing – It uses magnetic tape, the least expensive method of secondary storage. – It is the most efficient form of organisation when the entire of file or most of it is processed at once – Transaction file and old master file together act as a back-up, it can be used to create the new master file when existing one damaged or destroyed
  67. 67. 05/23/14 DBMS AT(CIT, Kili Com.net) 67 File Processing………. • Disadvantages .. – Time factor –the time it takes to access a particular record may be too long for many applications – The entire file most be accessed and a new master file created , even if only one record requires maintenance or updating.
  68. 68. 05/23/14 DBMS AT(CIT, Kili Com.net) 68 File Processing………. • Direct File Organisation – The data can be organised in such a way that they are scattered throughout the disk – This form of organisation that supports direct access also referred to as random access – The records can be accessed nearly instantaneously and in any order – When a record accessed, a record can be read or updated and when this process competed , then the system is free to respond to another request
  69. 69. 05/23/14 DBMS AT(CIT, Kili Com.net) 69 File Processing………. • Direct processing requires either magnetic disk or optical disk and cannot use magnetic tape • Direct access systems do not search the entire file rather, they move direct or nearly directly to the required record, to do this the system must have some way to determine where a particular record is stored • Example, in figure 4, data are entered directly into the system through a terminal that is in contact with the CPU of the central computer, the system locates the specific record in the master file and then updates it.
  70. 70. 05/23/14 DBMS AT(CIT, Kili Com.net) 70 File Processing………. Figure 4, Direct File Processing –Records are accessed directly
  71. 71. 05/23/14 DBMS AT(CIT, Kili Com.net) 71 File Processing………. • Direct file processing…. – There are several strategies which are used to find record.. • Relative addressing • Hashing (randomising) • Indexing • Relative addressing – Simplest method of finding a record – A record’s primary key is associated with a specific physical storage location – On retrieval process, the user enters the Key and the disk operating system associates this key with the appropriate location on the disk
  72. 72. 05/23/14 DBMS AT(CIT, Kili Com.net) 72 File Processing………. • Relative addressing…. – Relative addressing loses its appeal when the record key cannot be made to match the physical location • Hashing also known as Randomising – Method for determining the physical location of a record. – The record key is processed mathematically and another number is computed that represents the location where the record will be stored – Record keys are transformed into storage addresses and by using an arithmetic procedures called randomising or hashing algorithm
  73. 73. 05/23/14 DBMS AT(CIT, Kili Com.net) 73 File Processing………. – The task of this process is to take a set of records keys and find a formula to map them into set of disk storage location Identifiers – On retrieval process, user needs to retrieve the record once its key is entered and the hashing routine is used to determine where the record can be found on storage disks. – Major difficulty with the hashing procedure is due to that some addresses will never get generated whilst two or more record keys produce identical disk address or synonyms or Collisions
  74. 74. 05/23/14 DBMS AT(CIT, Kili Com.net) 74 File Processing………. • Indexing – It uses a primary index which associates a primary key with the physical location in which a record is stored. • Advantages of direct file organisation – Data can be accessed directly and quickly – Primary and secondary indexes can be used to search data in many ways – Files can still be processed sequentially using secondary index – Centrally maintained data can be kept up-date
  75. 75. 05/23/14 DBMS AS(CIT,IFM) 75 File Processing………. • Disadvantages of direct file processing – The use of an index lowers the computer system’s efficiency – The hardware must be expensive for these systems because all data must be stored on disks – There will be no backup data if a file destroyed, the files are updated directly and no transaction files are maintained on system
  76. 76. 05/23/14 DBMS AT(CIT, Kili Com.net) 76 File Processing………. • Summary on direct file organisation – The choice of file organisation and the methods used for direct access depend on the five characteristics • File volatility • File activity • File query needs • File size • Data currency
  77. 77. 05/23/14 DBMS AT(CIT, Kili Com.net) 77 Data Processing • Data processing comprises the following; – Capturing of data – Storing of data – Updating and retrieving of data and information • Data Management – Data management is the arrangement of all data and information with an organization – It also refers to the methods of physical storage and retrieval of data on a disk or other storage devices
  78. 78. 05/23/14 DBMS AT(CIT, Kili Com.net) 78 Data Management.. • Data management involves the following, – Data administration – The standards of defining data – The way in which people perceive and use data in their day-to-day activities
  79. 79. 05/23/14 DBMS AT(CIT, Kili Com.net) 79 Data Independence • Data Independence – Data independence allows a database to be structurally changed , it means data can be; • Added and deleted or data attributes altered with minimum disruption to the existing system • This implies that application programs are not required to have detailed knowledge of the records layout, it means when a record layout is changed like fields added, deleted, changed in size then fewer application programs or none would be changed
  80. 80. 05/23/14 DBMS AT(CIT, Kili Com.net) 80 Data Independence…. • There are two distinct levels of data independence; – Logical data independence – Physical data independence • Logical data independence – Insulates application programs from logical operations such as combining two records into one or splitting an existing record into two or more records
  81. 81. 05/23/14 DBMS AT(CIT, Kili Com.net) 81 Data independence…. • Physical data independence – Indicates that the physical storage structures or devices used for storing data could be changed, this happens without needing a change in the record structure or application programs
  82. 82. 05/23/14 DBMS AT(CIT, Kili Com.net) 82 Database Administration Roles • Database administration –Centrally controlling the database – Implemented by a person or group of persons under the supervision of a knowledgeable person called Administrator, this person known as Database Administrator (DBA) – DBA is responsible for supervising the creation, modification and maintenance of the database The DBA controls the database structure and sets up the definition for physical as well as logical implementation of the database.
  83. 83. 05/23/14 DBMS AT(CIT, Kili Com.net) 83 Database Administration Roles.. • Implementing Security Features, – DBA maintains the integrity of a database – DBA maintains that the database is not accessible by unauthorised users, – DBA is responsible for granting permission to use the database and stores the profile of each user – The user profile can be used by the DBA to verify that a particular user is allowed to access and perform a given operation on database within the limited time frame
  84. 84. 05/23/14 DBMS AT(CIT, Kili Com.net) 84 Database Administration Roles… • Measures Against Data Loss – DBA is responsible for defining procedures to recover data from failures –human natural, or hardware malfunctioning with minimum loss • DBMS Users – The users of a database can be classified depending on their degree of expertise or their mode of interactions with the DBMS.
  85. 85. 05/23/14 DBMS AT(CIT, Kili Com.net) 85 Database Administration Roles… • DBMS Users….. – The user can be classified as.. • Naïve Users • Online Users • Application Programmers • BDAs • Naïve Users – Are those users who need not be aware of the presence of the database system or any other system supporting their usage – Example, the users of an Automatic Teller Machine fall in this category.
  86. 86. 05/23/14 DBMS AT(CIT, Kili Com.net) 86 Database Administration Roles… • Naïve Users… – The user is instructed through each step of a transaction, user respond by pressing a coded key or numeric value – Operations that can be performed by Naïve user are very limited and affect on precise portion of the database Naïve users are ‘end users of the database who work through a menu driven application program where the type and range of response is always indicated to the user’ ( Jain et al., 2002)
  87. 87. 05/23/14 DBMS AT(CIT, Kili Com.net) 87 Database Administration Roles… • Online Users – Are those users who may communicate with the database directly via an online terminal or indirectly via a user interface and application program – These users are aware of the presence of the database system and may have acquired a certain amount of expertise with the limited interaction they are permitted with a database
  88. 88. 05/23/14 DBMS AT(CIT, Kili Com.net) 88 Database Administration Roles… • Application programmers – Professional programmers, who are responsible for developing application programs or user interface • Database Administrator – DBA is a knowledgeable person who is responsible for the physical design and management of the database
  89. 89. 05/23/14 DBMS AT(CIT, Kili Com.net) 89 Data Dictionary• A Data Dictionary is a database about databases, it holds the following information about each data element in the databases; – Name – Type – Range of values – Source – Access authorization – Indicates which application programs use the data. • A data dictionary may be a stand-alone information system used for management and documentation purposes, or it may be an integral part of the database management system. • Data dictionary is used to actually control the database operations, data integrity and accuracy
  90. 90. 05/23/14 DBMS AT(CIT, Kili Com.net) 90 Data Dictionary….. • Importance of Data Dictionary – It provides the name of a data element, its description, and data structure in which may be found – Provides great assistance in producing a report of where a data element is used in all programs that mention it – It is possible to search for a data name, provided keywords that describe that name
  91. 91. 05/23/14 DBMS AT(CIT, Kili Com.net) 91 Database Processing Figure 1, Components of a Database
  92. 92. 05/23/14 DBMS AT(CIT, Kili Com.net) 92 Database processing….. • What is a Database? – A collection of data designed to be used by different people, – Organised in such a way that a computer program can quickly select desired piece of information – A database consists of four elements; • Data • Relationships • Constraints • Schema • Data – Binary computer representations of stored logical entities – They are distinct piece of information usually formatted in a special way. – The term data is often used to distinguish binary (machine- readable) information from textual (human-readable) information.
  93. 93. 05/23/14 DBMS AT(CIT, Kili Com.net) 93 Database Processing…. – Example, some applications make a distinction between data files (files that contain binary data) and text files (files that contain ASCII data) – In database management systems, data files are the files that store the database information whereas other –index files and data dictionaries, stores administrative information known as metadata
  94. 94. 05/23/14 DBMS AT(CIT, Kili Com.net) 94 Database processing….. • Relationships – Relationships represent a correspondence between the various data elements • Constraints – Are predicates that define correct database states. • Schema – Describes the organisation of data and relationships within the database. – Defines various views of the database for the use of the system components of the database management system and for the application’s security as in figure 2
  95. 95. 05/23/14 DBMS AT(CIT, Kili Com.net) 95 Database processing….. • Schema… – It separates the physical aspects of data storage from the logical aspects of the representation – As in figure 2, • The internal schema defines how and where data are organised in physical data storage • The conceptual schema defines the stored data structures in terms of the database model used. • The external schema defines a view/s of the database for particular users. In this case the database management system provides services for accessing the database whilst maintaining the required correctness and consistency of the stored data
  96. 96. 05/23/14 DBMS AT(CIT, Kili Com.net) 96 Database processing….. Figure 2, Organisation of a Database
  97. 97. 05/23/14 DBMS AT(CIT, Kili Com.net) 97 Database processing….. • Why a Database – Why should an organisation have an integrated database to store its operational data? – Deficiencies of pre-database information processing include (but not limit to) the following… • Data inconsistency • Lack data integrity • Data repetition or redundancy • Interdependence between programs and data files • Lack of foolproof data security mechanisms • Lack of coordination across applications using common data • Non-uniform back-up and recovery methods • Encoded data
  98. 98. 05/23/14 DBMS AT(CIT, Kili Com.net) 98 Database processing….. • The advantage of having the data in a database are; – Redundancy can be reduced –having a centralised database redundancy or multiple copies of the same data can be reduced – Inconsistency can be avoided –this depends on data redundancy, which means when the same data is duplicated and changes are made at one site, which is not propagated to the other site, then it gives rise to inconsistency. So if the redundancy is removed chances of having inconsistent data is also removed – Data can be shared –the existing application can share data in a database – Standards can be enforced –with the central control of the database, the DBA can enforce standards – Security restrictions can be applied –the DBA can define authorisation checks to be carried out wherever access to sensitive data is attempted.
  99. 99. 05/23/14 DBMS AT(CIT, Kili Com.net) 99 Database processing….. – Integrity can be maintained –integrity means that the data in the database is accurate. Centralised control of the data helps in permitting the administrator to define integrity constraints to the data in the database – Conflicting requirement can be balanced – database designers can be able to create database that is the best for the organisation by knowing the overall requirements.
  100. 100. 05/23/14 DBMS AT(CIT, Kili Com.net) 100 Database processing….. • Characteristics of Data in a Database – Shared –a data in a database are shared among different users and applications – Persistence –data in a database exist permanently in the sense the data can live beyond the scope of the process that created – Validity/Integrity/ Correctness –data should be correct with respect to the real world entity that they represent – Security –data should be protected from unauthorised access – Consistency –whenever more that one data element in a database represents related real-world values, the values should be consistent with respect to the relationship – Non-Redundancy –no two data items in a database should represent the same real-world entity – Independence –the three levels in the schema (internal, conceptual and external) should be independent of each other so that changes in the schema at one level should not affect the other levels
  101. 101. 05/23/14 DBMS AT(CIT, Kili Com.net) 101 Types of Database Language • There are three types of database languages – DDL ( Data Definition Language) – DML (Data Manipulation Language) – DCL (Data Control Language)
  102. 102. 05/23/14 DBMS AT(CIT, Kili Com.net) 102 Types of Database Language… • DDL – Used to define data and their relationships to other types of data – Used to formulate schema-level concepts – Mainly used to create files, databases, data dictionaries, and tables within databases. – Defines the format or schema of the database
  103. 103. 05/23/14 DBMS AT(CIT, Kili Com.net) 103 Data Definition Language… – It allows specification of following information about each tables • The schema of each table • The integrity constraints • The set of values associated with each attribute • The security and authorization information for each table • The physical storage structure of each table on disk The SQL commands that are used to create database objects are known as Data Definition Language or DDL
  104. 104. 05/23/14 DBMS AT(CIT, Kili Com.net) 104 Types of Database Language…… • DML – DML is a language which deals with the processing or manipulation of various database objects – It provides for the program interface to open and close database, find records in files, navigate through the records, add new records and change or delete existing records – To formulate changes to be effected in a database instance The SQL commands that are used to manipulate data within database objects are called Data Manipulation Language or DML
  105. 105. 05/23/14 DBMS AT(CIT, Kili Com.net) 105 Types of Database Language…… • DCL – DCL is a language which used to improve security features and thus prevents unauthorised access to data in the database – Security is provided by granting or revoking privileges on a user – Privileges determines whether or not a user can execute a given command or a command can be executed on specific groups of data The SQL commands that are used to control the behaviour of database objects are called Data Control Language or DCL
  106. 106. 05/23/14 DBMS AT(CIT, Kili Com.net) 106 Database Management Systems (DBMS) • Outline – Introduction to DBMS – Database Architecture – Database Management System – Why DBMS – Types of DBMS
  107. 107. About the Author My name is Aiwinia Temba. I grew up in Kilimanjaro until I was 25 and then I moved down to Moshi, Marangu, where I live now. I began going to college down here but soon dropped out once I realized it wasn’t for me. Sure, I was interested in computers and Web Programming, but most of the courses I was taking in college were totally unrelated. I dropped out figuring that I would be able to learn more on my own than any college could ever teach me. So I began reading computer books and he works as a freelance developer in teaching computers science since 2013 and over the years has written several articles an, programmer and technical writer/editor. He has been involved d tutorials on Office Applications and Web Programming. A lot. Shortly after reading a few books on web design, I was hooked. I wanted to know everything and anything about it. I was designing websites any chance I could. I spent almost all of my savings buying more books on different programming languages and other nerdy computer gear. I was addicted. The whole concept of computer and programming fascinated me. As I continued to study more and more, I began to realize that most of the books seemed to lack excitement. The material was useful, but they were far from entertaining. I tried to look online for a more interesting source of learning but to no success. That's when I discovered YouTube.
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×