Week 4 Flashcards

1
Q

What is the domain in a relational model?

A

Range of the values in a column; the data type of the attribute

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

What is a tuple in a relational model?

A

The data in a row

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

What is a attribute in a relational model?

A

The name of the columns

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

What is a relation in a relational model?

A

The ‘table’ (NOT EXACTLY)

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

What are the relation components?

A
  1. Relation schema (the NAME of the relation)

2. Relation body (the attributes of the relation)

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

What are the relation components?

A
  1. Relation schema (the NAME of the relation)

2. Relation body (the attributes of the relation)

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

Whats the difference between a relation and a table?

A

Main difference is that in a table, data can be input freely

In a relation, tuples (rows) are unique

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

What is the degree and cardinality of a relation relational model?

A
Degree = number of attributes (columns)
Cardinality = number of tuples (rows)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a primary key in a relational model?

A

This uniquely identifies a tuple in a relation

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

What is a foreign key?

A

This shows the relationship between two relations

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

What is a candidate/minimal key?

A

A super key that does not contain a subset of any other super key

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

What is normalisation?

A

A process that ssigns attributes to entities so that data redundancies are reduced or elimatnted.

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

What are the stages of normalisation?

A
  1. First normal form (1NF)
  2. Second normal form (2NF)
  3. Third normal form (3NF)
  4. Fourth normal form (4NF)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is denormalisation? Why necessary sometimes?

A

The process of lowering the stage of a normal form.

Required to sometimes meet performance requirements as lower forms have greater performance but greater redundancies.

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

What is the prime attribute?

A

A key attribute that is an attribute that is a part of a key or is the whole key.

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

What are key attributes?

A

The attributes that form the primary key

17
Q

What is a nonprime attribute?

A

An attribute that is NOT a part of a key

18
Q

What is a non-key attribute?

A

An attribute that is NOT a part of a key

19
Q

What is the objective of normalisation?

A

To ensure that each relation conforms tto the concept of well-formed relations.

20
Q

What is the concept of well-formed relations? List the charactersistics of a well-formed relation.

A
  • Each relation only contains data for a single entity
    (i. e. STUDENT will only contain data for students)
  • No data item will be unnecessarily stored in more than one relation. Reduces chance of data anomalies/inconsistencies.
  • All non-prime attributes in a relation are dependent on the primary key
  • Each relation is void of insertion, update or deletion anomalies. Ensures integrity and consistency of data.
21
Q

What are the characteristics of the first normal form (1NF)

A
  • Table format
  • No repeating groups
  • PK identified for the main relation
22
Q

What are the characteristics of the second normal form (2NF)

A
  • All of 1NF

- No partial dependencies based on any candidate keys

23
Q

What are the characteristics of the third normal form (3NF)

A
  • All of 2NF

- No transitive dependencies

24
Q

What is the Boyce-Codd normal form? What are its characteristics?

A

It is a special case of a 3NF BUT every determinant is a candidate key.

25
Q

What are the characteristics of the fourth normal form (4NF)

A
  • All of 3NF

- No independent multivalued dependencies

26
Q

What is functional dependence?

A

The attribute B is fully functionally dependent on attribute A if each value of A determines ONE and ONLY ONE value of B

i.e. Think bijectivity between set B and set A

27
Q

What is partial dependency?

A

When an attribute is depenedent on only a portion of the primary key.

28
Q

What is transitive dependency?

A

When attribute A determines attribute B and attribute B determines attribute C. Attribute A and C have a transitive dependency.

29
Q

What is a repeating groups?

A

A group of multiple entries of the same type can exist for any SINGLE key attribute occurence.

30
Q

What are the steps to normalisation to 1NF?

A
  1. Eliminate repeating groups
  2. Identify PK
  3. Identify all dependencies
31
Q

What are the steps to normalisation to 2NF?

A
  1. Make new relations to eliminate partial dependencies

2. Reassign corresponding dependent attributes

32
Q

Should the foreign key be different name compared to the primary key?

A

NO, unless the FK and PK in a single relation are the same name

33
Q

What is an INSERT anomaly?

A

When adding data to a relation you are required to add other related data.

Other data may be unavalable, cant process with INSERT

34
Q

What is UPDATE anomaly?

A

Changing the value in a tuple may require updating of multiple other tuples.

Missing one of the rows to be changes will result in data inconsistencies

35
Q

What is a DELETE anomaly?

A

When data to be deleted causes other data to be deleted.

When you delete the last row that contains data that you dont want to lose.