1.3.2 Databases Flashcards

1
Q

What is a relational database?

A

A database that recognises the difference between entities, using a different table for each

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

What is an entity?

A

An item about which information is stored

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

What is a flat file database?

A

A database that consists of a single file, usualy one entity

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

What is a primary key?

A

A unique identifier given to each record in a table

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

What is a foreign key?

A

An attribute that links two tables together

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

What is a secondary key?

A

An index other than the primary key used to search and sort through a database with more convenience and speed

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

What is meant by capturing data?

A

The process of getting information to be stored in a database

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

What is meant by selecting data?

A

The process of removing excess information to extract only the data required

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

What is meant by managing data?

A

Manipulating information collected in any way

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

What is the most common language used to manipulate information in databases?

A

Structured Query Language (SQL)

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

What is a one-to-one entity relationship?

A

Each table can only be linked to one other table

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

What is a one-to-many entity 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
13
Q

What is a many-to-many entity relationship?

A

One entity can be associated with many other entities and the same applies for the other

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

How can a many-to-many relationship be created?

A

Creating a third table
Using two one to many relationships to third table

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

What is normalisation?

A

Creating the best possible design for a relational database

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

Give 4 things normalisation tries to accomplish.

A

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

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

How is first normal form achieved?

A

No attribute can contain more than a single value

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

How is second normal form achieved?

A

In first normal form
No partial dependencies

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

How is third normal form achieved?

A

In second normal form
No non-key dependencies

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

What is a partial dependency?

A

When an attribute depends on part of the primary key

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

What is a non-key dependency?

A

When an attribute 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
22
Q

What is indexing?

A

Method that stores the position of each record when ordered by a certain attribute

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

What is indexing used for?

A

Looking up & accessing data quickly

24
Q

State the function of the SELECT statement.

A

Collects fields from a given table

25
State the function of the FROM statement.
Specifies which table/tables the information to search is stored
26
State the function of the WHERE statement.
Specifies search criteria
27
How can the SELECT, FROM, WHERE statements be used together?
SELECT Attributes FROM Table WHERE Attribute / Criteria
28
State the function of the ORDER BY statement.
Species whether selected data is to be put in ascending/descending order
29
How can the ORDER BY statement be used?
ORDER BY Attribute Asc/Desc
30
State the function of the JOIN statement.
Combines rows from multiple tables based on a common field between them
31
How can the JOIN statement be used?
SELECT Table1.Attribute1 / Table2.Attribute2 ... FROM Table1 JOIN Table2 ON Table1.Attribute3 = Table2.Attribute3
32
State the function of the CREATE statement.
Allows new databases to be made
33
State the function of the SELECT statement.
Collects fields from a given table
34
What details must be specified for each attribute when using the CREATE function?
Whether or not attribute is primary key Data type of attribute Whether attribute needs to be filled in
35
State the function of the ALTER statement.
Add, delete or modify columns in a table
36
How is ALTER used to add a column to a table?
ALTER TABLE TableName ADD Attribute & DataTypes
37
How is ALTER used to delete a column to a table?
ALTER TABLE TableName DROP COLUMN Attribute
38
How is ALTER TABLE used to modify a column to a table?
ALTER TABLE TableName MODIFY COLUMN Attribute & DataType
39
State the function of the INSERT INTO statement.
Inserts a new record into a table
40
How can the INSERT INTO statement be used?
INSERT INTO Column1, Column2 VALUES Value1, Value2
41
State the function of the UPDATE statement.
Updates a record in a table
42
How can the UPDATE statement be used?
UPDATE TableName SET Column1 = Value1, Column2 = Value2 ... WHERE Column = Value
43
State the function of the DELETE FROM statement.
Deletes a record from a database table
44
How can the DELETE FROM statement be used?
DELETE FROM TableName WHERE Column = Value
45
What is referential integrity?
A process that ensures consistency to make sure information isn't removed if required elsewhere in a linked database
46
What is a transaction?
A single operation executed on data
47
What is transaction processing?
The processing of information within single transactions in line with ACID
48
What does ACID stand for?
Atomicity Consistency Isolation Durability
49
What is meant by Atomicity?
A transaction must be processed in its entirety or not at all
50
What is meant by Consistency?
A transaction must keep the referential integrity rules between linked tables
51
What is meant by Isolation?
Simultaneous execution of transactions must lead to the same result as if they were executed one after the other
52
What is meant by Durability?
One a transaction has been completed it will remain so
53
What is record locking?
The process of preventing simultaneous access of records in a database
54
What is record locking used for?
To prevent inconsistencies or a loss of updates within data
55
What is meant by deadlock?
When two or more transactions are waiting indefinitely for one another to give up locks
56
What is meant by redundancy?
The process of having one or more copies of data in physically different locations
57
What is the benefit of redundancy?
If there is any damage to one copy of data, others can be recovered