Lecture -2
The traditional file system has many serious problems, especially when data grows
large or many people use it. Here are the main disadvantages explained in detail:
1. Data Redundancy The same information is duplicated in several files. Different
programmers or departments create their own files, so employee details,
customer info, or student records appear multiple times.
o This wastes storage space.
o It increases maintenance effort because every copy must be updated
separately.
o Example: Employee address stored in HR file, payroll file, and department
file.
2. Data Inconsistency Because of redundancy, when one copy is updated, others
may remain old. This leads to wrong or mismatched data.
o Example: An employee's address is changed in one file but not in others →
different departments have different addresses for the same person.
3. Difficulty in Accessing Data Retrieving specific information is hard and
inefficient. You often need to write a new program for each query. There is no
easy way to search or combine data from different files.
4. Data Isolation Data is scattered across many files in different formats (some in
text, some in binary, etc.). Getting data from multiple files for a new report or
application becomes very difficult and time-consuming.
5. Integrity Problems It is hard to enforce rules on data (e.g., age > 18, salary
cannot be negative). These rules must be coded in every program, and mistakes
can happen easily.
6. Atomicity Problems An operation must be completed fully or not at all (atomic).
In file systems, if a program crashes in the middle (e.g., during bank transfer),
partial updates may occur, leading to corrupted data. No automatic rollback
exists.
7. Security and Access Control Issues There is little or no control over who can
access or modify which data. Anyone with file access can change anything,
leading to risks.
8. Program-Data Dependence Programs are tightly linked to the file structure. If
you change file format or add a field, you must change many programs. This
makes maintenance expensive and error-prone.
9. No Concurrency Control If multiple users try to update the same file at the
same time, data can get corrupted. No built-in mechanism prevents this.
10. Lack of Flexibility Adding new features or reports requires writing new programs
from scratch. It is not flexible for changing business needs.
11. create it in easy languange and detailed
Advantages of DBMS (Why we use DBMS instead of simple files or folders)
1. No data repetition (removes redundancy) In old file systems, the same
information is written many times in different files (example: student name
in marks file, fee file, attendance file). This wastes space and creates
confusion. DBMS stores every piece of data only once in one place — so no
duplication, less space used, and no mistakes.
2. You can get exactly the data you want in any format You can ask questions
(queries) and get only the needed information quickly. Example: "Show all
students who got more than 80% in Math" — DBMS gives the list in seconds.
3. Data stays separate in different tables for easy use Data is divided into
separate tables (like one for students, one for courses, one for teachers).
This makes everything clean, easy to understand, and simple to manage.
4. Fast and easy access using simple queries You use easy commands (like
SQL SELECT) to get data very quickly, even from millions of records. No need
to search manually.
5. Data stays correct and follows rules (data integrity) You can set rules like:
o Age must be between 18–60
o Phone number must have 10 digits
o Marks cannot be negative DBMS automatically checks and stops
wrong data from entering.
6. Atomicity (all or nothing changes) If you do an operation (like transferring
money from one account to another), either both steps happen completely,
or nothing happens. No half-done work — this keeps the database correct
always.
7. Many people can use it at the same time (concurrent access) Multiple users
can work on the same database together without problems. DBMS uses
locking and other techniques so no one's work disturbs others.
8. High security You can decide who sees what. Example:
o Manager sees everything
o Normal employee sees only his own data
o Outsiders see nothing DBMS uses passwords, roles, and encryption
to protect data.
These are the main reasons why companies, schools, banks, hospitals, etc., love
using DBMS.
of the Traditional File System
Detailed Comparison Table (in easy language)
Conventional
Sr. Database
File System Why it matters (Explanation +
No Feature / Point System
(Traditional Example)
. (DBMS)
Files)
In file system: Student name &
Very less or address saved in marks file, fee file,
Data A lot — same data
almost none. library file → wastes space + hard
1 Redundancy is repeated in
Data is stored to update everywhere. DBMS:
(Duplication) many files.
only once. Stored once → save space + easy
updates.
High security.
Very low security. In file system: Hard to stop a clerk
You can set
Anyone with file from seeing salary details. DBMS:
who sees what
2 Security access can Clerk sees only student info,
(roles,
see/change manager sees everything —
passwords,
everything. protects private data.
permissions).
Used when Used only when
Big organizations choose DBMS
When to use high security is
security is not
because they handle sensitive data
3 (Security needed (banks,
very important
and many users. Small home use →
needs) hospitals, (small personal
file system is okay.
companies). files).
Data is DBMS example: Student table
Data is
unstructured or connected to Course table → easy
Data structured (in
loosely organized. to see "which student enrolled in
4 Structure & tables) + clear
Files are isolated which course". File system: You
Relationships relationships
— no automatic have to open many files manually
between data
connection. and match by hand.
Conventional
Sr. Database
File System Why it matters (Explanation +
No Feature / Point System
(Traditional Example)
. (DBMS)
Files)
(like foreign
keys).
Very high. If you Example: Change student phone
Very less.
update one file but number in one file but not in fee file
Data Changes reflect
5 forget others → → next time fee reminder goes to
Inconsistency everywhere
wrong/mismatche old number → confusion. DBMS
automatically.
d data. fixes this automatically.
User does NOT
In DBMS: Just write query
know physical
How user User must know "SELECT * FROM Student" — no
address/locatio
accesses data exact file name need to know where file is saved.
6 n of data.
(Physical and location File system: You type
DBMS hides it
location) (path) to open it. "C:\School\Students\2025\[Link]
(data
" — annoying and error-prone.
independence).
Hard — you get
Very easy — DBMS: Ask "Show only students
data only in the
Retrieving get data in any with >80% marks in table form" →
format it was
7 data in desired format using instant. File system: Open file,
saved. No easy
format simple queries copy-paste to Excel, sort manually
way to
(SQL). → takes time.
change/format it.
Easy and safe
— many users Difficult — if
Concurrent DBMS: 10 clerks update different
can work files are spread
access student records at once — no crash.
together over multiple
8 (Multiple File system: Two people open same
without places, cannot
users at same file → one overwrites other's
problems access/change at
time) changes → data lost.
(locking same time safely.
mechanism).
- Backup &
recovery easy
Other (automatic
- No built-in
common tools). -
backup. - No If power fails during money
points (extra Atomicity (all
9 atomicity. - transfer: DBMS rolls back (undoes)
for or nothing
Integrity depends fully. File system may leav
understanding changes). -
on programmer.
) Data integrity
rules
(constraints).
1.5 Levels of Abstraction in DBMS (Three Levels Explained)
Data Abstraction means hiding unnecessary details and showing only what the user
needs. It makes the database easy to use — different people see different "levels" of
detail.
There are three main levels of abstraction (also called the Three-Schema Architecture):
1. Physical Level (Internal Level / Lowest Level)
o This is the deepest, most technical level.
o It shows how data is actually stored on the hard disk or storage device.
o Details like: files, blocks, bytes, indexes, compression, pointers, storage
locations, disk sectors, etc.
o Example: A student record might be stored as a block of consecutive
memory locations (like bytes 1000–1200 on disk).
o Who uses it? System programmers or very low-level experts.
o Normal users and programmers never see this level — DBMS hides it
completely.
o Purpose: Focus on speed, efficiency, and how to store data best on
hardware.
2. Logical Level (Conceptual Level / Middle Level)
o This is the main logical view of the entire database.
o It describes what data is stored and how data is related — without
caring about physical storage.
o Details like: tables, columns (attributes), data types, relationships, keys
(primary, foreign), constraints.
o Example: "There is a Student table with RollNo, Name, Age; Course table
with CourseID, Name; and Student enrolls in Course relationship."
o Who uses it? Database designers and administrators (DBA) decide what
to store here.
o Programmers write code based on this level (like CREATE TABLE
commands).
o Purpose: Gives a clean, overall picture of the whole database structure —
independent of hardware.
3. View Level (External Level / Highest Level)
o This is the easiest and highest level for normal users.
o It shows only a small part of the database that a particular user needs.
o Each user can have their own "view" (custom picture) of the data.
o Example:
▪ A clerk in railway reservation sees only passenger name, train,
seat, date — nothing about payment details or employee salary.
▪ A manager sees reports and summaries.
▪ A student sees only his own marks and attendance.
o Multiple views can come from the same logical level (same database).
o Purpose: Makes interaction simple and secure — user sees only what
they need, hides rest.
o Also provides security (different users get different access).
How they connect (from your figure description):
• View level (many small views) → sits on top of → Logical level (full database
structure) → sits on top of → Physical level (actual storage).
• Changing physical storage (like moving to faster disk) does not affect views or
logical level → this is called data independence.
Quick Note on View (from your last part)
• What is a View? A view is like a virtual table — it's not real storage, but a saved
query that shows data from one or more real tables. Example: CREATE VIEW
StudentMarks AS SELECT Name, Marks FROM Student WHERE Class = '10'; It
looks like a table, but it's just showing selected data.