4 - 17 Relational Databases And Normalisation Flashcards

1
Q

What is a relational database?

A

A relational database is a collection of tables in which relationships are modeled by shared attributes.

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

Describe the structure of a table in a relational database

A

One row of a table holds one record. Each column in the table represents one attribute.

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

Book (BOOKID, DeweyCode, Title, Author, DatePublished)

Which is the entity name, attributes and primary key

A

The entity name is shown outside the brackets
The attributes are listed inside the brackets
The primary key is normally underlined but in CAPS in this case.

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

What is a primary key?

A

The primary key is composed of one or more attributes that uniquely identify a particular record in the table. (When describing an entity this is called an entity identifier)

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

How do you link database tables?

A

Tables may be linked through the use of a common attribute. This attribute must be a primary key of one of the tables, and is known as the foreign key in the second table.

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

What are the three possible types of relationship between entities?

A

one-to-one, one-to-many and many-to-many.

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

What is Normalisation?

A

Normalisation is a process used to come up with the best possible design for a relational database.

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

Give the four criteria that a relational database should be

A

No data is unnecessarily duplicated
Data is consistent throughout the database. Consistency should be an automatic consequence of not holding any duplicated data. This means that anomalies will not arise when data is inserted, amended or deleted.
The structure of each table is flexible enough to allow you to enter as many or as few items as required
The structure should enable a user to make all kinds of complex queries relating data from different tables.

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

Criteria of 1NF

A

A table in first Normal Form (1NF) if it contains no repeating attribute or groups of attributes.

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

Represent two entities in standard notation which have a many-to-many relationship - Product and Component

A

Product (PRODUCTID, ProductName, Costprice)

Component (COMPID, CompName, SupplierID, SupplierName)

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

Criteria of 2NF

A

A table is in second Normal Form (2NF) if it is in 1NF and contains no partial dependencies. 2NF is best described as partial key dependence test.

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

What is a partial dependency?

A

A partial dependency is where one or more of the attributes depends on only part of the primary key, which can only occur if the primary key is a composite key.

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

Criteria of 3NF

A

A table is in third Normal Form (3NF) if it is in second normal form and contains no ‘non-key dependencies’.

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

What is a non-key dependency?

A

A non-key dependency is one where the value of an attribute is determined by the value of another attribute which is not part of the key.

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

What does 3NF mean?

A

All attributes are 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
16
Q

The importance of normalisation- no data redundancy

A

One of the aims of normalising a database is to remove the possibility of redundant data from any of the tables. Redundant data is data that appears in more than one database table, which can cause inefficiencies and inconsistencies in the data.

17
Q

The importance of normalisation- Maintaining and modifying the database

A

DATA INTEGRITY is maintained since there is no unnecessary duplication of data. Eg changing data in one table will change the data in every other table where it applies meaning there will be no possible inconsistencies.

18
Q

The importance of normalisation - Faster sorting and searching

A

Normalisation will produce smaller tables with fewer fields. The results in faster searching, sorting and indexing operations as there is less data involved.

19
Q

The importance of normalisation - Deleting records

A

A normalised database with correctly defined relationships between tables will not allow records in a table on the ‘one’ side of a one-to-many relationship to be deleted accidentally.