Theory: Databases Flashcards

1
Q

Describe the reasons for database normalisation (6)

A

-efficient without compromising data integrity
-no redundant or repeated data
-faster searching and sorting
-easier to maintain
-duplication of data minimised
-improved data consistency

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

What is needed to create a data model?

A

Data requirements

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

Describe a data model

A

An abstract model of which entities to record and which attributes of each entity

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

What does each entity in a table have?

A

A row/record

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

Describe the concept of an entity identifier

A

-sometimes called primary key, or composite key.
-a unique value used to identify a single record
-primary keys are single attributes/fields that use only one field to determine a unique value
-composite keys (or composite primary keys) use multiple attributes/fields to form a unique value for a record.

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

Describe an entity description:

A

-eg. Customer(customerID, customeremail)
-describes how information about an entity should be stored in a table.
-the name of the table as well as field names within the brackets

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

How is the entity identifier/primary key identified in an entity description?

A

A value can be underlined

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

Describe the concept of a relational database

A

-a database containing multiple tables that are linked by common attributes.

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

What relationship type is not supported by relational databases?

A

Many to many

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

Describe the concept of a foreign key

A

-an attribute/field of a table that is the primary key of another table

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

Describe first normal form

A

-no repeating attributes
-data is atomic, all fields contain one value and only one. Two values can not be stored in one field.

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

Describe second normal form

A

-partial key dependancies are removed
-For a database with a composite primary key, attributes that don’t depend on all values that make the composite key, are removed to form another table

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

Describe the concept of third normal form

A

-no non-key dependancies
-all non key attributes depend 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
14
Q

Properties of SQL

A

-declarative, readable

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

List as many SQL commands as you can

A

-SELECT
-UPDATE
-INSERT INTO…VALUES()
-DELETE
-WHERE
-FROM
-UPDATE
-SET
-ORDER BY
-CREATE (TABLE)
-VARCHAR(size)CHAR(size)
-INT(size)FLOAT(size)

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

what is the wildcard you’ve learned?

A

-*

17
Q

Describe the complexities of a client server database

A

-simultaneous access supported for multiple clients
-issues arise when clients attempt to access the same field-concurrent access
-can result in updates being lost

18
Q

List some methods used to preserve data integrity in a client server database

A

-record locks
-serialisation
-timestamp ordering
-commitment ordering

19
Q

Describe record locks

A

-when a record is accessed by one client/user, it is immediately locked.
-other clients/users are blocked from accessing or modifying the record until it is unlocked

20
Q

Describe serialisation

A

-placing other user requests in a queue to be serially executed after the current user is finished

21
Q

Describe timestamp ordering

A

-commands performed on a field are assigned a timestamp and are carried out in the order of the timestamps

22
Q

Describe commitment ordering

A

-an algorithm determines the order by which to execute commands on the same field based on reducing the impacts of commands on other parts of the database.

23
Q

How are many to many relationships handled with databases?

A

A link table is created that utilises the unique identifier of values to map entities to each other.

24
Q

Why is database normalisation needed?

A

So that databases can be efficient without compromising the data integrity. It ensures that entities contain no redundant or repeated data.

25
Q

How can the data of a database be defined in first normal form?

A

atomic- no single column contains more than one value.

26
Q

What does the term atomic mean, when referring to data in a database?

A

No single column contains more than one value.

27
Q

What is concurrent access?

A

When two people access a database at the same time

28
Q

What is the problem with concurrent access?

A

Can result in updates being lost if two users edit a record at the same time

29
Q

What are some processes used to prevent concurrent access?

A

-record locks
-serialisation
-timestamp ordering
-commitment ordering

30
Q

What are some processes used to prevent concurrent access?

A

-record locks
-serialisation
-timestamp ordering
-commitment ordering