File Organisation Flashcards

1
Q

Files and Records

A
  • A file is collection of related records
  • A record is a collection of related fields
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Fixed Length and Variable Length Fields

A
  • Fixed length field / record has same number of bytes in each field / record (and
    same number of fields) / Variable length record has different number of bytes in
    each record (or different number of fields).
  • Fixed length field / record is easier to program as it can be calculated to know
    how much storage space will be required / Variable length field / record makes it
    difficult to calculate how much storage space will be required
  • Fixed length field / records are quicker to process (read/write) by computer as start and end locations are known / Variable length field / records are slower to process (read/write) by computer as start and end locations have to be calculated at read/write time
  • Fixed length field / record wastes storage space as fields have blank space / Variable length field / record saves storage space as no blank space
  • Fixed length field / record will truncate long fields / Variable length record avoids truncation as each field can extend to accommodate any number of characters

Examples
- Variable length fields e.g. – Name, Address, email address
- Fixed length fields e.g. – Gender, DOB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Index Sequential

A

Index Sequential
- Records stored in key sequence order
- An index allows data to be accessed directly / index contains key field and disk address of record / the key field and index are used to locate the position

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Direct Random Access

A

Direct Random Access:
- Physical location for new record is calculated from the key field
- A hashing algorithm is used for this calculation to find the location
- If data collision / something there, the record is stored instead in an overflow area
- Data in the overflow area is normally stored and searched in a linear manner
- The overflow becomes too large
- File may need reorganising (and new hashing algorithm)
- Existing records are accessed in the same way
- when searching for the record, the program would first look in the original disk block and find a pointer for the record which would direct the program to the overflow area.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Serial and Sequential files

A

In a sequential file the records are stored in order (usually on primary key field) while in a serial file the records are not stored in any order (or order of arrival). To add to a serial file the new record is appended to the end of the file. In serial files no order to the data is maintained. To add to a sequential file, a new file is made by copying the old file until an insertion is required then inserting the new record and copying the rest of the file. In sequential files order is maintained when new records ae added, useful for storing master files

Serial files
- Only a Linear search could be used to search this type of file as the data is not in order.
- Can be stored on tape or disk, but tape ideally as it is faster to search linearly rather than moving backwards and forwards

Sequential files
- record key makes searching for a particular record much faster using a binary search, again can be stored on tape or disk.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Transaction/Master file

A

To add to a serial file the new record is appended to the end of the file. To add to a sequential file, a new file is made by copying the old file until an insertion is required then inserting the new record and copying the rest of the file. The old file is then deleted.

To add to a new sorted file (sequential file) to input files are the old master file and the new sorted transactional file. Each record is compared with each corresponding record in the master file and the master file is updated where appropriate. New master file is outputted, bill is outputted and an error log is outputted

To add to a sequential file, a new file is made by copying the old file until an insertion is required, inserting record and copying over the rest of the file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly