2.4 Organisation and Structure of Data Flashcards

1
Q

What is a serial file?

A

File where records are not stored in any particular order, they are just stored in the order they occur.

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

How do you add to a serial file?

A

A new record is just added to the end of the file.

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

What is a sequential file?

A

File where records are stored and accessed in file sequence order e.g. sorted by a primary key.

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

How do you add to a sequential file?

A

Make a new copy of the records until the correct place to add the new record is reached.
Add the new record to the new copy and continue until the end of the file is reached.
If multiple records are to be added, they should be sorted before so there isn’t multiple updates to the file.

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

How do you delete records from a sequential file?

A

Make a new copy of all the records until the record to be deleted is reach.
Do not make a copy of the record to be deleted.
Continue until the end of the file is reached.
If multiple records are to be deleted, they must be sorted in advance.

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

What are random files?

A

File where records are stored at an address based on the Key Field.
This allows individual records to be accessed without loading the entire file.

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

How can data collisions occur in random files?

A

When two data items are hashed to the same location.
The latest data must then be stored in an overflow area.
If there are too many data items in the overflow area, access becomes slow.
To fix this, a new hashing algorithm may be required or a larger file may be needed.

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

What is an indexed sequential file?

A

File structure where records are stored in key sequence order but there is also an index which allows data to be accessed directly.
(Benefits of sequential and random file access, stored on random access media)

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

What is an index in an indexed sequential file?

A

Stored at the start of the file and given the highest key stored in each ‘block’ of the file.
When a key is searched for, the index will indicate which block the file is stored in.

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

What is a Multi-Level index?

A

An index which is too large so it is split into smaller indexes.
The index at the start to the file would point to other smaller indexes instead of the data.

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

How do you add records to an indexed sequential file?

A

Place in a block.
If block is full, use overflow area.
Access may become slower as more records are in this area, re-organisation may become necessary.

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

How do you delete records from an indexed sequential file?

A

Record to be deleted is marked as deleted in the index but not physically removed.

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

What is a hashing algorithm?

A

Takes the key field and performs a calculation to return a disc address.

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

What happens when the hashing algorithm allocates a record an address to a block that is already full?

A

The computer will store the record in an overflow area whilst also leaving a pointer at the original block to indicate where the record is now stored.

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

What is the difference between a record and a file?

A

A record is a collection of items all relating to an object and a file is an organisation of these records.

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

What is a Master File?

A

File that holds descriptive data and resultant data after a process is complete e.g. long term data records that doesn’t need to be changed frequently.

17
Q

How is data held in a master file?

A

Data is stored sequentially in key field order.

18
Q

What is a Transaction File?

A

A temporary file used to store data which will be used to update the master file. It also contains the transactions that should be made in the master file.

19
Q

How is data held in a transaction file?

A

Data is stored serially in temporal order.

20
Q

Describe the process of how a master file is updated using a transaction file.

A

Transaction file is sorted into the same order as the master file.
Each transaction record is read and used to update the corresponding record in the master file.
The remaining master records are read from the old master file and written to the new one.

21
Q

How can fixed length records be located?

A

The position of the record can be calculated by multiplying the record length by the record sequence number.
A fast binary search can be used in a sequential file.

22
Q

What is an advantage of updating Fixed-Length records?

A

They can be quickly updated in-situ without affecting other records in the file as long as empty space is present.

23
Q

What are two ways variable length records records can be stored?

A

With a field terminator at each field and a record terminator at the end.
Each field can start with its size and the record starts with a byte showing the length of the whole record.

24
Q

What is a disadvantage of using Variable Length Records?

A

They can only be found using a slower linear search method.

25
Q

When are variable length records used?

A

Preferred when records in a file are of varying lengths, this is to avoid wasting memory space.
They are suitable for situations where no searching or updating is necessary e.g. transaction files which will be used later to update master files.

26
Q

What is Archiving?

A

The process of storing data/files which are no longer in current or frequent use.
Should be stored securely as it is still held for security/legal reasons.

27
Q

What is a three generation file backup system?

A

Stores three of the most recent versions of the master file. (GFS, Grandfather, Father, Son)

28
Q

Why is Backing-Up Files important for Master Files?

A

The most recent versions of a master file can be re-created by using an Old Master file backup and recent Transaction file.

29
Q

What are Transaction Logs?

A

Where file access requests are logged with the time, data and username along with the names of the files that were accessed.