database concepts
DESCRIPTION
TRANSCRIPT
![Page 1: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/1.jpg)
Introduction to Database Concepts
Ucc - Mwanza.
May 2006
![Page 2: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/2.jpg)
Database Definition
A database can be defined as collection of information organized in such a way that it can be accessed easily.
Examples are Tracking customer orders
Maintaining Employees Records.
Maintaining Students Information
![Page 3: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/3.jpg)
Terminologies
In studying Databases the following Terminologies must be clear
Data This is the fact or facts about specific entity (person, place or thing).
Information This is the processed facts perceived to be useful by the user.
Field This is a single item of information or data in entity. E.g. employee
Name
Record This can be defined as data or group of fields about an entity.
E.g. employee particulars Subject (relation or table)
This can be defined as a collection of records that are related to a particular entity. For example, Records for all employees will make up one subject.
![Page 4: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/4.jpg)
History of Databases
Manual systems
File Processing Systems (FPS)
Database Management systems (DBMS)
![Page 5: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/5.jpg)
Manual systems
Structure
Information can be stored in dedicated room or in separate offices.
Room or office will be furnished with shelves;
Different shelves will hold Records for different subjects.
Records will be stored in hard flat files, each file will carry one record
Each file will have a specific number to identify it.
A person will use the file number to retrieve the specific file (record).
![Page 6: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/6.jpg)
Manual systems
User
File keeper
Files Cabinet
![Page 7: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/7.jpg)
File Processing Systems (FPS)
Information stored as groups of records in separate files File processing systems consisted of a few data files and many application programs Each file called a soft flat fileFlat file contain processed information for one specific function Use of programming languages to write applications Little flexibility High maintenance Many limitations
![Page 8: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/8.jpg)
![Page 9: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/9.jpg)
Limitations of File Processing Systems
Separate and isolated data Data redundancy Program - data interdependence involving file formats and access techniquesDifficulty in representing data from the user’s view Data inflexibility
![Page 10: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/10.jpg)
Database Management systems (DBMS)
A program that allows users to define, create, manipulate, store, maintain, retrieve, and process the data in a database in order to produce meaningful information.
Focus on information representation
Data stored as records in various database files that can be combined to produce meaningful information for users
DBMS controls all functions of capturing, processing, storing, retrieving data and generates various forms of data output
Manages access by multiple users and multiple programs to a common store of data
![Page 11: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/11.jpg)
![Page 12: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/12.jpg)
DBMS overcomes all Limitations of FPS.
Eliminates separation and isolation of data
Reduces data redundancy
Eliminates dependence between programs and data
Allows for representation of data from user’s view
Increases data flexibility
Superior flexibility and security over spreadsheet applications
![Page 13: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/13.jpg)
Characteristics of a DBMS
Computerized record-keeping system Contains facilities that allow the user to:
o Add, delete files o Insert, retrieve, update, delete data
Collection of databases; each can be used for separate purposes or combined
![Page 14: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/14.jpg)
Functions and Uses of a DBMS
To store data To organize data
To control access to data To protect data To provide decision support
To provide transaction processing
![Page 15: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/15.jpg)
Advantages and Disadvantages of a DBMS
• Advantages: Centralized data reduces management problems Data redundancy and consistency are controllable Program - data interdependency is diminished Flexibility of data is increased
• Disadvantages: Reduction in speed of data access time Requires special knowledge Possible dependency of application programs to specific
DBMS versions
![Page 16: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/16.jpg)
Database Administrator
A database administrator (DBA) controls and manages the database.
Function of a DBAMake decisions concerning the content of the databasePlan storage structures and access strategies.Provides support to usersDefines security and integrity checksInterprets backup and recovery strategies.
![Page 17: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/17.jpg)
Types of Databases
Flat Databases
Hierarchical Database
Network Database
Relational Database
![Page 18: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/18.jpg)
Flat databases
A single kind of record with a fixed number of fields.
a way of organizing all information in a single table.
suitable for extremely simple databases.
inherit data redundancy
![Page 19: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/19.jpg)
Flat databases
![Page 20: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/20.jpg)
Hierarchical Database
Fields or records structured in nodes Viewed as branches of an upside-down tree Each item is subordinate to its parent node Only one parent per node The subordinate item is the child node to the parentIf parent node is deleted, all the child nodes are as well deletedNew parent node must be created before adding a new child node Limited by rigid structure
No direct relationships between child nodes
![Page 21: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/21.jpg)
Hierarchical Database
![Page 22: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/22.jpg)
Network Database
Also has hierarchical node arrangement But here child nodes may have more than one parent node, or a many-to-many relationship The interconnected design allows for access via multiple pathways
![Page 23: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/23.jpg)
Network Database
![Page 24: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/24.jpg)
Relational Database
No pre-determined access paths
Data stored in a collection of columns and rows called a table, or a relation
Tables may be electronically linked via a key field containing common data
Easy to add, delete and modify the data and the table structures
![Page 25: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/25.jpg)
Relational Database
![Page 26: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/26.jpg)
Relational Terminologies
Table or Relation
Null values
Duplicate Values
Changeable Values
Primary Keys
Foreign Keys
![Page 27: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/27.jpg)
Table or Relation
Table will store information for a particular entity
Table name must be unique The Table name should be descriptive
Column Name must be unique within the Table
Rows must be unique
![Page 28: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/28.jpg)
Null values
missing or unknown value in a column of a table
Nulls are not the same as zeros
Most arithmetic operations can be performed on zero values
nulls must be excluded from mathematical manipulations
![Page 29: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/29.jpg)
Duplicate values
A duplicate value is a value in a column of a table that exactly matches some other values within the same column.
![Page 30: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/30.jpg)
Changeable values
value in a table that may vary over time.
Most values in most tables are Changeable
You can prevent changes when it is desirable to prevent changes in a given column of a table
![Page 31: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/31.jpg)
Primary keys
Uniquely identify each row of that table.
Every table must have only one Primary key
![Page 32: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/32.jpg)
Rules for Primary key
Must always have a value (null values are not allowed)
Value should be unique (duplicate values are not allowed)
Value should not change over time
![Page 33: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/33.jpg)
Foreign keys
key which relates the rows of the Table to other Tables
value can be null,
value can change
value can be duplicated
![Page 34: Database concepts](https://reader034.vdocument.in/reader034/viewer/2022051514/54b5c37d4a795989418b45c6/html5/thumbnails/34.jpg)
Rule for Foreign keys
Value must refer to the existing primary key.