0% found this document useful (0 votes)
9 views

File System Vs Database System Scenerio Discussion

FILE SYSTEM

Uploaded by

JABBAR ALTAF
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

File System Vs Database System Scenerio Discussion

FILE SYSTEM

Uploaded by

JABBAR ALTAF
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Scenario: Hospital Patient Management System

You are managing a small hospital that keeps track of patient records, doctor information, and
appointment schedules using a traditional file system. Each type of information is stored in
separate text files: one for patients, one for doctors, and one for appointments.

Questions:

1. Data Organization: Compare how data is organized in your traditional file system versus a
relational database system. What are the advantages and disadvantages of each?
2. Data Redundancy: Identify potential data redundancy issues in your current file system
setup. How can a database management system (DBMS) help reduce this redundancy?
3. Querying Data: Explain how you would generate a report of all appointments for a specific
doctor along with patient names in both systems. What are the differences in execution?
4. Scalability: Discuss the challenges you might face as the hospital grows using a traditional
file system. How does a DBMS provide a more scalable solution?

Solutions:

1. Data Organization

Traditional File System:

 Data is stored in separate text files (e.g., patients.txt, doctors.txt, appointments.txt).


 Each file is a simple list with no structured relationships.

Advantages:

 Easy to set up for small data volumes.


 Minimal hardware and software requirements.

Disadvantages:

 Data retrieval is inefficient, as it requires manual searching through multiple files.


 Lack of enforced relationships increases the risk of data inconsistencies.

Relational Database System:

 Data is organized into structured tables (e.g., Patients, Doctors, Appointments) with defined
relationships.

Advantages:

 Efficient data retrieval using SQL for complex queries.


 Relationships enforce data integrity and consistency across the system.
Disadvantages:

 Requires initial setup and familiarity with database concepts.


 More resource-intensive than a flat file system.

2. Data Redundancy

Traditional File System:

 Data redundancy can occur when patient details are recorded multiple times for different
appointments, leading to inconsistencies.

How a DBMS Helps:

 A DBMS reduces redundancy by normalizing data. Patient details are stored in one table,
and each appointment references the patient through a foreign key, ensuring data is only
recorded once.

3. Querying Data

Traditional File System:

 To generate a report of all appointments for a specific doctor:


1. Open the appointments.txt file and search for the doctor’s ID.
2. Note the corresponding patient IDs.
3. Cross-reference those IDs in the patients.txt file to find patient names.
o This process is labor-intensive and prone to errors.

Relational Database System:

 You could run a single SQL query:

sql
Copy code
SELECT Patients.name, Appointments.date
FROM Appointments
JOIN Patients ON Appointments.patient_id = Patients.id
WHERE Appointments.doctor_id = 'specific_doctor_id';

 This retrieves the needed information efficiently and accurately with a single command.

4. Scalability
Challenges with Traditional File System:

 As the hospital expands and the number of patients and appointments grows, managing
multiple text files becomes increasingly cumbersome.
 Performance issues may arise as file sizes increase, resulting in slow data retrieval and
updates.
 Maintaining data integrity becomes difficult with many files, increasing the likelihood of
errors.

How a DBMS Provides Scalability:

 A DBMS can handle large volumes of data efficiently with indexing and optimized querying.
 Supports concurrent access, allowing multiple users (e.g., nurses, doctors) to access the
system simultaneously without conflicts.
 Adding new data (e.g., new patient fields or appointment types) is easier, and schema
changes can be managed more flexibly.

You might also like