Week 24 Databases Flashcards

(10 cards)

1
Q

DESCRIBE two problems that can occur with databases that are not fully normalised.

A

Redundant/duplicated data may waste storage space;
NE. data redundancy, data duplication

If data is stored more than once then it could be inconsistent // two copies of the ‘same’ data item might store different values;

If data is stored more than once then each copy of the data would need to be updated if it changed;
NE. eliminate update anomalies

It might not be possible to store data about one type of entity without creating a record for another type of entity // if a record for one type of entity does not exist then it might not be possible to store data about another type of entity;
NE. eliminate insertion anomalies

When a record for one type of entity is deleted it might delete the data about another type of entity // it might not be possible to delete a record for one type of entity without deleting the data about another type of entity;
NE. eliminate deletion anomalies

May be difficult to select/edit data if it is not atomic // if there are repeating groups;

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

What does it mean for a database to be fully normalised (3rd normal form)?

A

every attribute is dependent on the key;
the whole key;
and nothing but the key;

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

Explain the term ‘relational database’

A

A collection of tables which can be linked together by means of primary and foreign keys.

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

Define the term attribute

A

A property or characteristic of an entity (databases).

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

Define the term primary key

A

A field that is unique for every record in a table.

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

Define the term composite primary key

A

A primary key made up of two or more fields.

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

Define the term foreign key

A

A field in one table that is also a primary key in another table.

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

Describe how timestamp ordering can be used to manage concurrent access to a database. [3]

A

Timestamps are generated for each transaction // timestamps indicate the order that transactions occurred in;

Database records time(stamp) of last read / last write transaction for each record;

Database server applies rules to determine if processing a transaction will result in loss of data integrity (and if so aborts the transaction);

•   if a transaction tries to write to a record, then the transaction should be aborted if the read/write timestamp on the record is greater than the time at which the transaction started

•   if a transaction tries to read a record, then the transaction should be aborted if the write timestamp on the record is greater than the time at which the transaction started.

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

Describe how record locks manage concurrent access to a database [2]

A

When a user starts to edit a record a lock is set on the record;

Other transactions/users cannot edit (A. access) the record until the lock is released;

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

Describe how commitment ordering manages concurrent access to a database

A

Commitment ordering looks to optimise the order in which transactions are completed.

It will consider the order of the transactions alongside dependencies to ensure any conflicts are resolved.

Transactions which will cause a deadlock will be blocked until any dependant action is complete.

An algorithm is used to create a commit order which avoids conflicts between transactions.

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