1.2.3) Databases Flashcards

1
Q

What is a flat file database?

A

A database that has one table

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

What is a relational database?

A

A database with multiple related tables connected through keys

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

What is a primary key?

A

A unique identifier for a record in a table.

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

What is a foreign key?

A

A field in one table that links to the primary key in another which creates a relationship

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

What is a secondary key?

A

An attribute used to search the database but not always unique.

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

What is an entity in databases?

A

People or things

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

What is entity-relationship modelling (ERM)?

A

A diagram for showing entities and the relationships between them

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

What is a 1:1 relationship in ER modelling?

A

One entity relates to another one entity (e.g., Person → Passport).

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

What is a 1:M relationship in ER modelling?

A

One entity relates to many others (e.g., Customer → Orders).

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

What is a M:N relationship in ER modelling?

A

Many-to-many; must be broken into two 1:M with a linking table.

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

What is indexing in a database?

A

A technique for speeding up data retrieval, often using B-trees or hash tables.

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

Name two methods of data capture.

A

Forms and Optical Character Recognition (OCR).

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

How is data selected from a database?

A

Using queries like SQL SELECT statements and filters.

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

What are common data management tasks?

A

CRUD: Create, Read, Update, Delete operations.

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

What are two methods of exchanging data between systems?

A

JSON/XML files and APIs (Application Programming Interfaces).

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

What is normalisation?

A

The process of dividing larger tables into smaller interlinked tables

17
Q

What does 1NF require?

A

Atomic fields and no repeating groups.

18
Q

What does 2NF require?

A

1NF + no partial dependencies (non-key attributes must depend on the whole key).

19
Q

What does 3NF require?

A

2NF + no transitive dependencies (non-key fields must depend only on the key).

20
Q

What is a transitive dependency?

A

When a non-key attribute depends on another non-key attribute.

21
Q

What does SELECT * FROM Customers; do?

A

Retrieves all columns and rows from the Customers table.

22
Q

Write an SQL query to find customers in ‘London’.

A

SELECT * FROM Customers WHERE City = ‘London’;

23
Q

What does UPDATE do in SQL?

A

Modifies existing data in a table.

24
Q

What does DELETE FROM Orders WHERE OrderID = 101; do?

A

Deletes the order with OrderID 101 from the Orders table.

25
What does JOIN do in SQL?
Combines rows from two or more tables based on a related column.
26
What is referential integrity?
A rule ensuring foreign keys match valid primary keys in another table.
27
What happens if referential integrity is not maintained?
Orphan records can appear, breaking data consistency.
28
What is an 'orphan record'?
A record whose foreign key value references a non-existent primary key value
29
How can referential integrity be enforced in SQL?
By declaring foreign key constraints (e.g., FOREIGN KEY REFERENCES).
30
What is transaction processing?
Executing a sequence of database operations that are treated as a single logical unit.
31
What does ACID stand for?
Atomicity, Consistency, Isolation, Durability.
32
Define Atomicity in ACID.
Ensures all parts of a transaction are completed or none at all.
33
Define Consistency in ACID.
Guarantees the database remains in a valid state before and after a transaction.
34
Define Isolation in ACID.
Prevents interference from other concurrent transactions.
35
Define Durability in ACID.
Ensures once a transaction is committed, it remains even in a system failure.
36
What is record locking?
A method to prevent simultaneous access to data, avoiding conflicts.
37
What is data redundancy?
Duplication of data across the database, often avoided through normalisation.