1.3.2 Databases Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a flat-file database?

A

A database that consists of a single file, usually based on a single entity.

Can be written by => Entity(Attribute1, Attribute2, Attribute3)

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

What is a relational database?

A

A set of tables whose records are linked by certain fields.

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

What is a primary key? How is it shown in a table?

A

A field which has a unique value for every record.

They are underlined.

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

What is a secondary key?

A

A non-unique but specific identifier which allows data to be searched easier.

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

What is a foreign key?

A

A field which links to a primary key in a different table. It is the primary key in one table, and the foreign key in another.

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

What is normalisation in databases?

A

The process of coming up with the best possible layout for a relational database.

It tries to achieve:

  • No redundancy
  • Consistent data throughout linked tables
  • Complex queries can be carried out
  • Records can be added and removed without issues
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is 1NF?

A

Contains no repeating attributes (atomic) and has a primary key.

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

What is 2NF?

A

Already in 1NF and contains no partial dependencies (every field depends on the primary key).

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

What is 3NF?

A

Already in 2NF and contains no non-key dependencies.

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

What is referential integrity?

A

Changes on a database are kept consistent to ensure data isn’t used if it’s required elsewhere in a linked database.

E.g. If a record is removed, all references to it are removed.
E.g. A foreign key must have a corresponding primary key in a different table.

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

What does ACID stand for and what does each term mean?

A

Atomicity => A transaction must fully complete, not just partially.
Consistency => All transactions must follow the rules of the programming language (maintain referential integrity).
Isolation => Simultaneous execution of transactions must give the same result as if they were executed one after the other.
Durability => Once a transaction has been committed, it’ll remain so, even in the event of a powercut.

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

What is record locking?

A

Preventing simultaneous access to records in a database.

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

What is deadlock?

A

When two records are locked due to them being processed but the records depend on each other for the transaction.

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

What is redundancy?

A

Having multiple copies of the same data in physically different locations.

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