Database
A database is an organized collection of data that is stored
in a way that makes it easy to access, manage, and update. Instead of keeping
information in random papers or separate files, a database stores it in a
structured form, usually in tables, so that the same data can be used by many
people without mistakes or repetition.
Example:
Imagine a school keeping student records. Without a
database, every teacher might keep their own list of students, which could
cause errors like different spellings of names or missing information. With a
database, all student details (name, roll number, class, results) are stored in
one place, and every teacher can access the same correct information whenever
needed.
Data
Data means raw facts and figures that have no clear meaning
on their own. It can be numbers, words, or symbols collected from different
sources.
Example: If a teacher writes down marks like 85, 92, 74,
these are just data. They don’t tell us much until we know whose marks they are
or in which subject.
Information
Information is data that has been processed and given
meaning, so it becomes useful for decision-making.
Example: When we arrange the marks with student names (Ali –
85, Sara – 92, Ahmed – 74), it becomes information because now we understand
who scored what.
Data vs Information
·
Data is raw, unorganized,
and without context.
·
Information is processed,
organized, and meaningful data.
Example: A list of numbers like 1200, 1500, 1800 is data.
But if we know these numbers are monthly sales in rupees for Jan, Feb, and Mar,
it becomes information that helps a shopkeeper see business growth.
Traditional File Processing System
A traditional file processing system is a way of storing
data in separate files on a computer without using a database. Each application
creates and manages its own files, which makes it difficult to share, update,
or keep data consistent. This often causes duplication of data and errors
because the same information is stored in many places.
Example: In a college, the admission office, exam section,
and library may all keep their own files of student details. If a student
changes address, the update has to be made separately in each file. If one file
is updated but others are not, it leads to inconsistency and confusion.
Advantages of Traditional File Processing System
·
Simple to Use: Easy for
small organizations to maintain because files are directly created and
accessed.
·
Low Cost: No need for
expensive database software or special hardware.
·
Good for Small Data: Works
well when the amount of data is limited and not complex.
·
Direct Storage: Data is
saved directly into files without extra steps or structures.
·
Independence: Each
department can manage its own files according to its needs.
Disadvantages of Traditional File Processing
System:
1. Data Redundancy and Inconsistency
In a traditional file system, the same piece of data is
stored in many different files across departments or programs. This causes
redundancy, which means the same data is unnecessarily repeated. Over time,
these copies can become different from each other, leading to inconsistency.
This makes it hard to know which copy is correct.
Example: A student’s address is saved in the admission file,
the exam file, and the hostel file. If the student shifts to a new home and
only the admission file is updated, the exam and hostel files will still show
the old address. When teachers or staff use this data, they may get the wrong
information.
2. Program–Data Dependency
In TFS, the structure of data (how it is arranged in files)
is strongly tied to the application program that uses it. This is called
program–data dependency. Whenever the data structure changes, the program must
also be changed, recompiled, and tested, which is a time-consuming and costly
process.
Example: Suppose student records are saved in a file with
columns for Roll No, Name, and Marks. If the school decides to add “Email” to
the record, all programs that read or write student data must be modified. The
exam system, library system, and attendance system will all need changes,
making it difficult to manage.
3. Security Problem
In file systems, each application controls its own files,
and there is no central system to manage security. This makes it harder to
protect sensitive data from unauthorized access. Since there are no
fine-grained controls, anyone who has access to the computer or file may be
able to read, copy, or even change the information.
Example: If exam results are stored in a file, a staff
member who is not authorized could still open the file and edit student marks.
Unlike modern database systems where passwords and access levels are managed,
the traditional system does not provide strong security features.
4. Data Isolation
Data isolation means that data is kept in different files
without proper links, making it hard to combine or retrieve related
information. Since each file is independent, gathering data from multiple files
requires manual effort or custom programming. This slows down decision-making.
Example: If the principal wants a report showing which
students borrowed books from the library and also failed in exams, staff must
check the library file and the exam file separately, then manually match the
roll numbers. This process is slow and error-prone.
5. Program Maintenance
Because programs and files are closely connected, even small
changes in data structure can force programmers to update many different
programs. This increases the cost, time, and effort required for program
maintenance. As systems grow, maintenance becomes more difficult and
inefficient.
Example: If the student ID system changes from 3 digits
(like 101) to 5 digits (like 20201), all programs that store, search, or
display student IDs need to be updated. This could affect the admission, exam,
and library systems, requiring major work just for a small change.
6. Integrity Problem
Integrity means keeping data correct, consistent, and
reliable. In TFS, it is difficult to apply rules (called constraints) that
ensure integrity. Because of this, invalid or wrong data can easily enter the
system and remain unnoticed, reducing the accuracy of the stored data.
Example: A student’s age might be entered as “200 years” in
one file and “20 years” in another. Since there is no central control to stop
wrong entries, such errors continue to exist. Later, when staff use the data,
it creates confusion and wrong reports.
Why We Use the Database Approach
The database approach is used because it solves the problems
of the traditional file system. In a database, all data is stored in one
central place and managed by a Database Management System (DBMS). This reduces
data repetition, keeps information consistent, improves security, and makes it
easy to access and share data among different applications. It also allows
rules to be applied so that data stays correct and reliable.
Example: In a university, instead of keeping separate files
in admission, exam, and library departments, all student information is stored
in one central database. If a student changes their phone number, it is updated
only once in the database, and all departments see the correct number
automatically. This saves time, avoids mistakes, and makes the whole system
more efficient.
Advantages of Database:
Central Storage of Data: All information is kept in one
place, so different departments and applications can use the same accurate
data.
Consistency of Records: Once data is updated, every user
sees the latest version, which avoids mistakes and confusion.
Better Security Control: Access to data can be given based
on roles (like admin, teacher, student), so only authorized people can view or
change information.
Easy Data Sharing: Many users can access and use the
database at the same time without disturbing each other’s work.
Quick and Flexible Access: Data can be searched, filtered,
or combined using queries, which saves time and helps in decision-making.
Rules for Accuracy: Databases can apply conditions (like age
must be a valid number, roll number must be unique), which keep the data
correct.
Reduced Work for Maintenance: Small changes in data or
structure can be handled by the DBMS, so programs don’t need to be rewritten
every time.
Kinds of Database:
1. Relational Database
A relational database stores data in the form of tables
(rows and columns) where each table is related to others using keys. It makes
it easy to organize, search, and connect data without repetition. The DBMS
ensures that relationships between tables remain accurate.
Example:
In a school system, one table stores student details,
another table stores courses, and a third table stores exam results. Using
relational links, we can easily find which student is enrolled in which course
and what marks they scored.
In a hospital, one table stores patient details, another
stores doctors, and another stores appointments. By linking tables, the
hospital can quickly find which doctor is treating which patient
2. Distributed Database
A distributed database is not stored in a single place;
instead, it is spread across different computers or locations. These parts work
together as one system, so users feel like they are using a single database. It
helps when data must be available in multiple branches or offices.
OR
A distributed database is a database that is divided into
different parts and stored on multiple computers or locations. Even though the
data is spread out, the system connects all these parts and makes them work
together like one single database.
Example:
When we send a WhatsApp message, it does not travel directly
to the receiver’s phone. Instead, it first goes to the nearest WhatsApp server,
which then passes it to another server located close to the receiver. The
receiver’s phone collects the message from that server. In this way, data is
stored and shared across many servers worldwide. This system ensures fast
delivery, reliability, and backup. Even if one server fails, another server
provides the message smoothly.
3. Cloud Database
A cloud database is a database that is kept on many
computers connected through the internet instead of being saved on one local
computer. It can be reached from anywhere in the world.
Example:
For example, A person
sitting in Pakistan, India, or America can log in to Google from their own
device, and the system will show their personal account and data from anywhere.
Components of Database Environment
1. Data
Data is the main element of the database environment. It
includes all the facts, figures, and information stored in the database,
usually in tables with rows and columns. Without data, the database has no
purpose.
Example: In a university database, student names, roll
numbers, courses, and exam results are all types of data stored for future use.
2. Software
Software is the program that manages the database, called
the Database Management System (DBMS). It helps users store, update, search,
and secure data easily.
Example: Oracle, MySQL, or SQL Server are DBMS software that
allow teachers to add marks, update attendance, and generate student reports.
3. Hardware
Hardware refers to the physical devices where the database
is stored and run. This includes servers, computers, storage drives, and
network devices that support the system.
Example: In a bank, customer account data is stored on
powerful servers, which allow employees’ computers to access records instantly
when customers visit a branch.
4. Procedure
Procedures are the rules and steps that guide how the
database is created, used, and maintained. They ensure that the data remains
accurate, secure, and well-managed.
Example: In a hospital, there may be a procedure that only
doctors can update medical records, while receptionists can only add patient
appointments.
5. Person/User
Users are the people who interact with the database for
different purposes. They can be administrators (who manage), programmers (who build
apps), or end-users (who simply use the data).
Example: In an online shopping database, administrators
manage inventory, developers create the website, and customers use the system
to place orders.
0 Comments