1.3.2 - Databases Flashcards

1
Q

What is an entity?

A

An entity is an item of interest about which information is stored

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

What is a relational database?

A

A relational database is a database which recognises the differences between entities by creating different tables for each entity.

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

What is a flat file?

A

A flat file is a database that consists of a single file. The flat file will most likely be based around a single entity and its attributes.

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

What is a primary key?

A

A primary key is a unique identifier for each record in the table.

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

What is a foreign key?

A

A foreign key is an attribute which links two tables together. The foreign key will exist in
one table as the primary key and act as the foreign key in another.

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

What is a secondary key?

A

A secondary key allows a database to be searched quickly. It can be allocated to a value which is likely to be specific to a user, e.g surname.

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

What is one to one entity relationship modelling?

A

Each entity can only be linked to one other entity, such as the relationship between a husband and wife.

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

What is one to many entity relationship modelling?

A

One table can be associated with many other tables, such as a mother having multiple children

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

What is many to many entity relationship modelling?

A

One entity can be associated with many other entities and the same applies the other way round. An example is students and courses.

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

What is normalisation?

A

Normalisation is the process of coming up with the best possible layout for a relational database

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

What does normalisation try to accomplish?

A

No redundancy (unnecessary duplicates).
Consistent data throughout linked tables.
Records can be added and removed without issues.
Complex queries can be carried out.

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

What is the first normal form?

A

There must be no attribute that contains more than a single value.

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

What is the second normal form?

A

A database which doesn’t have any partial dependencies and is in first normal form can be
said to be in second normal form.
This means that no attributes can depend on part of a composite key.

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

What is the third normal form?

A

If the database is in second normal form and contains no non-key dependencies, it is in third normal form.
A non-key dependency means the attribute only depends on the value of the primary key and nothing else.

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

What is indexing?

A

Indexing is a method used to store the position of each record ordered by a certain attribute. This is used to look up and access data quickly. Secondary keys are normally indexed, because the primary key is not normally remembered.

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

How can data be captured for databases?

A

Manually
Magnetic Ink Character Recognition (cheques)
Optical Mark Recognition
Optical Character Recognition

17
Q

How can data be transferred?

A

Using Electronic Data Interchange, which doesn’t require human interaction and enables data transfer between computers.

18
Q

What is SQL?

A

SQL is Structured Query Language, a declarative language used to manipulate databases.

19
Q

Basic SQL commands

A

SELECT
FROM
WHERE

20
Q

Ordering in SQL

A

SELECT
FROM
ORDER BY value Asc/Desc

21
Q

Joining in SQL

A

This provides a method of combining rows from multiple tables based on a common field.
SELECT
FROM
JOIN
ON value = value

22
Q

Creating in SQL

A

CREATE TABLE TableName
(
Attribute1 description, ,
)
The details should be specified:
whether it is the primary key.
Its data type.
Whether it must be filled in (not null)

23
Q

Data types in SQL

A

CHAR(n), VARCHAR(n), BOOLEAN, INTEGER, FLOAT, DATE, TIME, CURRENCY

24
Q

Altering in SQL

A

Adding a column:
ALTER TABLE TableName
ADD AttributeX and their dataTypes

Deleting a column:
ALTER TABLE TableName
DROP COLUMN AttributeX

Modifying the data type of a column:
ALTER TABLE TableName
MODIFY COLUMN AttributeX NewDataType

25
Q

Inserting in SQL

A

INSERT INTO (column1, column2, …)
VALUES (value1, value2, …)

26
Q

Updating in SQL

A

UPDATE TableName
SET column1 = value1, column2 = value2 …
Where columnX = value

27
Q

Deleting records in SQL

A

DELETE FROM TableName
WHERE columnX = value

28
Q

What is referential integrity?

A

This is the process of ensuring consistency. It ensures info is not removed if it is required elsewhere in a linked database.

29
Q

What is a transaction?

A

A single operation executed on data

30
Q

What is atomicity?

A

A transaction must be processed in its entirety or not at all

31
Q

What is consistency?

A

A transaction must maintain the referential integrity rules between linked tables

32
Q

What is isolation?

A

Simultaneous executions of transactions should lead to the same result as if they were executed one after the other

33
Q

What is durability?

A

Once a transaction has been executed it will remain so regardless of the circumstances surrounding it, such as in the event of a power cut.

34
Q

What is record locking?

A

The process of preventing simultaneous access to records in a database is called record
locking and it is used in order to prevent inconsistencies or a loss of updates.
While one person is editing a record, this ‘locks’ the record so prevents others from accessing the
same record.

35
Q

What is the danger with record locking?

A

It can lead to a deadlock, where people are waiting to access a locked record indefinitely.

36
Q

What is redundancy?

A

Redundancy is the process of having one
or more copies of the data in physically different locations.
This means that if there is any damage to one copy the others will remain unaffected and can be recovered.