Introduction to Databases
Importance of Data Storage
- Daily experiences often require keeping, searching, or reporting data.
- Traditional methods like diaries are inefficient, leading to:
- Unnecessary duplication of data
- Time wastage in searching for items
- Misleading reports due to poor data entry and organisation
- Poor data recovery
Database Management System (DBMS)
- Computerised systems have improved data management using DBMS.
- Definition: A database is a collection of structured and related data items organised to provide
consistent and controlled access.
Database Concepts
- DBMS Software: Tools for creating, organising, and maintaining databases (e.g., Microsoft Access,
Oracle, FoxPro, DbaseIV, Lotus Approach).
- Functions of DBMS Software:
1. Allow user to add or delete records.
2. Update or modify existing records.
3. Organise data for easy access, retrieval, and manipulation.
4. Interface between database and other applications.
5. Ensure security against unauthorised access and corruption.
6. Maintain statistics of data items.
Database Models
Databases are organised based on different models:
1. Flat File Model
- Contains one set of data, similar to manual files.
- Example: A teacher's assessment report for each student, library books catalogue.
- Sample Record:
- Name: Serah Seki
- Admission number: 649
- Total marks: 680
- Number of subjects: 10
- Average: 68
- Position: 4
2. Hierarchical Model
- Data arranged in a tree structure with levels.
- Example Structure:
- Level 1: Main data item
- Level 2: Data items at lower levels connected by paths.
- Note: Rarely used in modern databases.
3. Network Model
- Relationships expressed through links forming a network.
- Example Structure:
- Data items connected by multiple paths.
- Note: Rarely used in modern databases.
4. Relational Model
- Most common model used in modern computers.
- Related data stored in tables (relations).
- Tables Example:
- Customer Table:
- Customer Number: 900, 230, 450
- Name: Mary Koech, Peter Karimi, Bat Hori
- Telephone Number: 02078907, 0667896, 04456000
- Order Table:
- Customer ID: 900, 450
- Order Number: 2380, 811, 234, 567
- Date: 2/3/2004, 2/5/2004, 3/5/2004, 3/6/2004
- Amount: 90,000, 5,000, 13,000, 13,000
Object-Oriented Models
- Future model combining object and relational concepts.
- Data as independent objects relating to other database objects.
Features of Database Management Software
- Include Tables/Files, Queries, Reports generators, Form interface, etc.
- Microsoft Access includes:
- Macros: Automate operations.
- Modules: Custom programming.
Tables/File Structure
- Tables hold related records in rows (records) and columns (fields).
---