Section 11 - Databases and Normalisation Flashcards

1
Q

What is an entity?

A

A category of object, person, event or thing of interest to a organisation about which data is to be recorded

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

What does every entity in a database have?

A

Attributes

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

What are attributes?

A

Details of an entity

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

How are attributes listed?

A

Inside the brackets

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

What is a primary key?

A

A unique identifier for each record in a table

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

How is a primary key shown?

A

It is underlined

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

What are the 3 types of entity/table relationships?

A

One-to-one
One-to-many
Many-to-many

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

What is a one-to-one relationship?

A

Where each entity can only be linked to one other entity

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

What is a one-to-many relationship?

A

One table can be associated with many other tables

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

What is a many-to-many relationship?

A

One entity can be associated with many other entities, and vice versa

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

How are one-to-one relationships displayed?

A

A single line connecting the 2 entities

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

How are one-to many relationships displayed?

A

The line will have a branch on one side (the many side)

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

How are many-to-many relationships displayed?

A

There will be branches on both sides of the line

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

What is a relational database?

A

A collection of tables in which relationships are modelled by shared attributes

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

What is a foreign key?

A

A unique identifier that links 2 tables together. In one table the key will exist as the primary key, whilst in another table it will exist as a foreign key

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

What is a composite primary key?

A

A primary key that consists of more than one attribute

17
Q

What is a secondary key?

A

A unique identifier that allows a database to be searched quickly.

18
Q

How can a record with a particular primary key be found quickly?

A

The database will automatically maintain an index of primary keys, giving the position of their respective records

19
Q

What is normalisation?

A

The process of designing the best possible layout for a relational database

20
Q

What does normalisation attempt to accomplish?

A
  • No redundancy
  • Consistent data throughout the linked tables
  • Records can be added and removed without issues
  • Complex queries can be carried out
21
Q

What is first normal form?

A

A table is in 1NF if each attribute is atomic with no repeating attribute

22
Q

What is the definition of atomic?

A

Containing a single value

23
Q

What is a relation?

A

A table in a relational database

24
Q

When is a link table needed?

A

Whenever 2 entities have a many-to-many relationship

25
What is second normal form?
A table is in 2NF if it is in 1NF and it contains no partial dependencies
26
What is a partial dependency?
When one or more attributes depend on only part of the primary key
27
What does partial dependency occur?
When the primary key is a composite key
28
What is third normal form?
A table is in 3NF if it is in 2NF and all attributes are dependant on the key, the whole key, and nothing but the key
29
What are the advantages of normalisation?
- Maintaining and modifying the database - Faster sorting and searching - Deleting records
30
How is a normalised database easier to maintain and modify?
- Data integrity is maintained because there is no unnecessary duplication of data. This means that when an attribute needs updating, it only needs to be changed in a single position
31
How is a normalised database faster to sort and search?
A normalised database produces smaller tables with fewer fields, meaning there is less data and operations are quicker
32
How is a normalised database advantageous for deleting records?
If set up correctly, a normalised database will not allow records in a table on the 'one' side of a one-to-many relationship to be deleted accidently