Week 6 - Data Normalisation Flashcards

1
Q

What is Normalization

A

A methodology to enforce data integrity by construction

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

Why use normalization

A

Helps to:
- Preserve functional dependencies
- Avoid data redundancy and insertion/deletion anomalies
- Reduce the need for restructuring the schema
- Increase the life span of programs

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

What is an insertion anomaly in database design?

A

An insertion anomaly occurs when it is difficult to add data to a database due to the presence of redundant or incomplete information. For example, adding a new entity may require additional unrelated data to be inserted.

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

Can you give a practical example of an insertion anomaly?

A

In a database where customer orders and products are stored together, if a new customer is added who has not yet made an order, you would still need to insert a dummy order just to store the customer’s information, causing redundancy.

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

What is a deletion anomaly in database design?

A

A deletion anomaly occurs when removing data from a database causes unintended loss of other important data. For example, deleting a record could inadvertently remove details about other entities that are tied to it.

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

Can you give a practical example of a deletion anomaly?

A

In a database where employee and department information is stored together, if an employee is deleted, all the department information associated with that employee might also be removed, even if other employees in the department still exist.

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

What is a superkey?

A

A set of one or more columns that uniquely identify each row in your table. It should be functional (meaning if you know the values in the superkey columns, you can determine exactly one set of values for all the other columns)

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

What is a candidate key?

A

A minimal superkey. It is the smallest possible set of columns that can uniquely identify each row in the relation. If you remove any column, it stops being a superkey.

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

Who was Edgar Frank “Ted” Codd

A
  • British computer scientist
  • Father of relational model for databases
  • Turing award 1981
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does 1NF ensure?

A

That data is organized in a way that avoids hierarchical structures (e.g. tables inside tables)

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

A table is in 1NF if?

A

Each field in a table should contain a single, non-divisible value, and the table must represent a valid relationship between sets of values, containing no duplicates rows.

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

What are partial dependencies?

A

When a non prime attribute depends on only a part of a composite candidate key.

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

What is a prime attribute?

A

An attribute that is part of a candidate key

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

What is a non prime attribute?

A

An attribute that is not part of any candidate key

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

A table is in 2NF if?

A
  • It is in 1NF
  • No functional dependencies (where a non-prime attribute depends on only part of a composite key)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does 2NF ensure?

A

That non-prime atributes depend only on the entire candidate key, not just part of it.

17
Q

A table is in 3NF if?

A
  • It is in 2NF
  • It has no transitive dependencies
18
Q

How dou you eliminate Transitive Dependencies

A

By ensuring every non-prime attribute is functionally dependent only on a candidate key.
By ensuring functional dependencies satisfy one of the following:
- The determinant (left-hand side of the dependency) is a superkey.
- The dependent attribute (right-hand side) is a prime attribute.