Skip to content

Computer Science · Ch 8 — Database Concepts

File System

8.2

File System

A file is simply a container that stores data on a computer's storage device. The data inside a file can be anything — text, a computer program, comma separated values (CSV), pictures, audio, video, or a web page. Files stored on a computer can be accessed directly, and you can search them for specific data.

However, when a software program needs to access data from a file — for example, to display a monthly attendance report on a school website — you have to write a computer program to read that file. This is where the limitations of a file system begin to show.

Consider a school that needs to store data about students and their attendance. You would likely keep this data in two separate files. The first file, called STUDENT, contains six columns of information about each student:

  • RollNumber — the roll number of the student
  • SName — the name of the student
  • SDateofBirth — the student's date of birth
  • GName — the name of the student's guardian
  • GPhone — the phone number of the guardian
  • GAddress — the address of the guardian

Here is what the STUDENT file might look like:

The second file, called ATTENDANCE, stores the daily attendance records. It has four columns:

  • AttendanceDate — the date for which attendance was marked
  • RollNumber — the roll number of the student
  • SName — the name of the student
  • AttendanceStatus — marked as P (present) or A (absent)

Here is a sample of the ATTENDANCE file: …

Table 8.1STUDENT file maintained by office staff
RollNumberSNameSDateofBirthGNameGPhoneGAddress
1Atharv Ahuja2003-05-15Amit Ahuja5711492685G-35, Ashok Vihar, Delhi
2Daizy Bhutia2002-02-28Baichung Bhutia7110047139Flat no. 5, Darjeeling Appt., Shimla
3Taleem Shah2002-02-28Himanshu Shah981818485526/77, West Patel Nagar, Ahmedabad
4John Dsouza2003-08-18Danny DsouzaS -13, Ashok Village, Daman
Table 8.2ATTENDANCE file maintained by class teacher
AttendanceDateRollNumberSNameAttendanceStatus
2018-09-011Atharv AhujaP
2018-09-012Daizy BhutiaP
2018-09-013Taleem ShahA
2018-09-014John DsouzaP
2018-09-015Ali ShahA
2018-09-016Manika P.P
2018-09-021Atharv AhujaP
2018-09-022Daizy BhutiaP
2018-09-023Taleem ShahA