Databases Flashcards

1
Q

What is a Primary Key?

A

An attribute that provides a unique identifier for each entity in a database table

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

What is a Foreign Key?

A

An attribute in a table which is a primary key in another table

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

How do you create a many to many database?

A

A new table called a link table is created - which contains multiple foreign keys

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

What are the benefits of a normalised database?

A

1) More efficient to search through and sort as tables are split into much smaller tables
2) Easier to maintain as there is no duplication of data and consistencyof data is better - reduces the number of anomalies that occur

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

What is First Normal Form?

A

1) Remove repeating columns
2) Get rid of any groups of repeating data - for example there must be only one attribute per box
3) Identify the Primary Key
4) Separate data which isn’t atomic into separate values

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

What is Second Normal Form?

A

1)Must satisfy first normal form
2)Remove all Partial Key Dependencies - which is when one or more attributes depend on only part of the primary key - this occurs if a composite key is used
3) Must remove any many to many relatonships - so a linked table is made

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

What is a composite key?

A

A combination of two or more columns to uniquely identify each row in a database

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

What is third normal form?

A

1) Check data is in second normal form
2) Remove any Non Key Dependencies - When all attributes are dependent on the key, the whole key and nothing else but the key

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

What is a Client Server Database?

A

A server which provides simultaneous access to a single database for multiple clients

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

What are the issues with a Client Server Database?

A

If two people try to access and alter the same record at the same time - concurrent access occurs.

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

How can you fix concurrent access?

A

1) Record Locks - When a record is accessed by one user, it is immediately locked until the first user has finished using it - meaning nobody else can access or alter that record
2) Serialisation - Requests from a user to access the field are placed in a queue - once the first person has finished, the next person can use the queue

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