File Organisation Flashcards

1
Q

Give examples of different tile types

A

Word processing, spreadsheet files and so on

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

How is the content stored in a file?

A

Defined binary code that allows the file to be used in the way intended

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

What do computers, that store files for a specific purpose, store them as?

A

Binary File or

Text File

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

What is meant by a text file?

A

It contains data stored by a defined character code (ASCII).

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

How can you create a text file?

A

Using a text editor

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

How does a binary file store data?

A

In its internal representation i.e. an integer value might be stored in 2 bytes in 2s complement representation

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

How is a binary file created?

A

Via a specific program

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

How are binary files organised?

A

Based on a record

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

Explain what is meant by a record?

A

A file contains a record, and each record contains fields. Each field consists of a value

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

What is meant by a serial file?

A

It contains records which have no defined order.

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

How is a serial file used?

A

For banks to record transactions involving customer accounts. A program would be running. Each time there was a withdrawal or a deposit the program would receive the details as data input and would record these in a transaction file. The records would enter the file in chronological order but otherwise the file would have no ordering of the records.

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

What type of file is a text file?

A

Serial but it the file has repeating lines which are defined by an end of line character or characters. There is no end of record character.

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

Why must must a record in a serial file have a defined format?

A

To allow correct input and output

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

What is meant by a sequential file?

A

Records that are ordered

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

Why use sequential files?

A

For long term storage of data

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

What would be an alternative to a sequential file?

A

Database

17
Q

What is the difference between a sequential file and a serial file?

A

In banking, a sequential file could be used as a master file for an individual customer account. Periodically, the transaction file would be read and all affected customer account master files would be updated

18
Q

How are sequential files ordered?

A

Using a key field where the values are unique and sequential but not always consecutive

19
Q

What is the difference between a key field and a database primary key?

A

Primary key values are required to be unique but not sequentia

20
Q

How are records in a sequential file found?

A

By sequentially reading the value of the key field until the required value is found.

21
Q

State what is meant by direct access files?

A

It is known as random-access files where the randomness is only that the access is not defined by a sequential reading of the file.

22
Q

Where is direct access files used?

A

For large files

23
Q

Why is direct access used for large files?

A

It saves time compared to searching through a sequential file

24
Q

How is data stored in a direct access file?

A

In an identifiable record where finding it may involve an initial direct access to a nearby record followed by a limited serial search

25
Q

How is the chosen position for a record, when searching direct access, selected?

A

Using hashing algorithm

26
Q

How does a hashing algorithm work?

A
  1. Take the key field value as an input
  2. Outputs a value for the position of the record relative to the start of the file
  3. It will take into account the length of the file (number of records)
27
Q

Give an example of a hashing algorithm in action

A

1.If the key field has a numeric value then divide the value by a suitably large number
2. use the remainder from the division to define the position
3.The method will not create a unique position.
4.If a hash position is calculated that duplicates one already calculated by a different key, the next position in the file is used.
This is why a search will involve a direct access followed by limited serial search.

28
Q

State what is meant by file access

A

How is stored data in a file going to be used

29
Q

How should a serial file read an individual data item?

A

Successively read record by record until the required data is read.

30
Q

How should a sequential file read an individual data item?

A

Process is similar to serial but only the value in they key field has to be read.

31
Q

How should direct-access read an individual data item?

A

The value in they key field is submitted to the hashing algorithm which then provides the same value for the position in the file that was provided when the algorithm was used at the time of data input.

32
Q

How are files deleted or editted?

A

Sequential Files -

  1. create a new version of the file
  2. Data is copied from the old file to the new file until the record is reached which needs deleting or editing
  3. if deletion is needed, reading and copying of the old file continues form the next record
  4. If a record has changed, an edited version of the record is written to the new file
  5. remaining records are copied to the new file

Direct-Access:

  1. No need to create new file (unless file is full).
  2. A deleted record has a flag set so in the next reading process, the record is skipped over.
33
Q

Where is serial file organisation best used?

A

Batch processing or backing up data on magnetic tape

34
Q

Where is direct-access file organisation best used?

A

If a problem needs a file in which individual data items might be read, updated, or deleted then direct-access file organisation is most suitable -> serial least suitable