✅1.3.2 Databases Flashcards

(47 cards)

1
Q

State 2 benefits of using a relational database instead of a flat file database?

A
  1. Relational databases allows for less redundancy of data/less repeated data
  2. Relational databases improve the consistency of data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

State the difference between a primary key and a foreign key

A

A primary key will only appear once in a table/is a unique identifier. Whereas a foreign key may appear multiple times a table/may not be unique

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

What does ACID stand for?

A
  1. Atomicity
  2. Consistency
  3. Isolation
  4. Durability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a database?

A

An organised collection of data.

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

What is a flat file database?

A

A database that stores all data in a single table.

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

What is a primary key?

A

A unique identifier for each record in a table.

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

What is a secondary key?

A

A field or fields that are indexed for faster searching.

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

What is a foreign key?

A

A field in a table that refers to the primary key in another table used to link tables and create relationships.

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

What is a composite primary key?

A

A combination of 2 or more fields that are unique for all records.

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

What is a relational database?

A

A database that organises data into multiple tables, using keys to connect related data

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

What is a database management system?

A

Software used to store, retrieve, manipulate, and manage data in databases

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

What is normalisation?

A

The process of organising a database to reduce data duplication and improve data accuracy and consistency

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

What are the types of relationships?

A

One-to-one
One-to-many
Many-to-many

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

What is SQL?

A

A programming language used to interact with a database management system
(DBMS)

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

Describe what is meant by transactions being durable

A

(Committed) transactions are not lost in case of system failure.

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

Identify two methods of exchanging data with other computer systems

A
  1. CSV
  2. JSON
  3. XML
  4. SQL
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

State three requirements for a database to be in First Normal Form (1NF).

A
  1. Each record has a primary key
  2. Data is atomic
  3. No repeating groups of attributes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

State two requirements for a database to be in Second Normal Form (2NF).

A
  1. In 1NF
  2. Have no partial dependencies (non-primary key attributes must not depend on only part of the primary key (in the case of a composite primary key))
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

State three requirements for a database to be in Third Normal Form (3NF).

A
  1. In 2NF
  2. Contains no non-key dependencies (all attributes are dependant on the key, the whole key and nothing but the key)
  3. Have no transitive dependencies (non-primary key attributes must not depend on other non-primary key attributes)
20
Q

What is a field?

A

A single piece of data in a record.

21
Q

What is a record?

A

A group of related fields, representing one data entry.

22
Q

What is a table?

A

A collection of records with a similar structure.

23
Q

What are 3 pros of electronic databases?

A
  1. Easier to add, delete, modify and update data
  2. Data can be backed up and copied easier
  3. Multiple users, from multiple locations, can access the same database at the same time
24
Q

What is an entity?

A

Something worthy of capturing and storing data about e.g. students, orders.

25
What does referential integrity do?
It ensures consistency between related tables in a relational database. And maintains valid relationships between primary and foreign keys
26
Name 2 pros of referential integrity
1. Ensures data consistency and accuracy 2. Prevents orphaned records.
27
Name 2 cons of referential integrity?
1. Can impact performance due to additional checks 2. May require additional planning and design
28
What are 3 ways to maintain referential integrity?
1. Use a DBMS with built in support 2. Implement triggers to enforce custom referential integrity rules 3. Regularly validate and clean up data to ensure consistency
29
What is an entity relationship diagram?
A diagram that represents the entities (tables) that will be in a database and the relationships between these entities.
30
How can you resolve implementing a many to many entity relationship model?
Create a new table known as a 'link' table that goes between the entities. []—<[]>—[]
31
What is data integrity?
Data integrity refers to maintaining and ensuring the reliability of data in terms of its accuracy, completeness, and consistency over its lifecycle.
32
What is indexing?
A technique used to speed up data retrieval in a database.
33
What are 2 pros and 3 cons of a flat file database?
Pros: 1. Simple 2. Easy to understand Cons: 1. Causes data redundancy 2. Inefficient storage 3. Harder to maintain
34
Describe what is meant by transactions being atomic
A transaction must be processed in its entirety or not at all.
35
Describe what is meant by transactions having consistency
A transaction must maintain the referential integrity rules between linked tables.
36
Describe what is meant by transactions having isolation
Simultaneous executions of transactions should lead to the same result as if they were executed one after the other.
37
What is Record Locking?
The process of preventing simultaneous access to records in a database, ensuring data consistency and integrity.
38
Give one way that durability can be achieved for a completed transaction.
Completed transactions stored in secondary storage / data not stored long-term in RAM/cache
39
Give two disadvantages of using record locking
1. Can cause delays (as users wait for access) 2. Can cause deadlock
40
Explain how record locking can be used to ensure that the ACID principle of isolation is achieved when carrying out multiple transactions. [3]
1. Transactions having isolation means simultaneous executions of transactions should lead to the same result as if they were executed one after the other. 2. Record locking allows one user to access record level data at any one time 3. So data that is being used elsewhere cannot be used
41
What is redundancy?
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.
42
Name one disadvantage of indexing
The index takes up extra space in the database.
43
Users can build up playlists of their songs. Two tables are created called Playlist and Songs. Explain why a third table called PlayListEntry is needed. [3]
1. Songs and Playlist would have a many to many relationship 2. This is not allowed 3. Adding a table between them resolves this
44
Explain what is meant by verification using double entry? [2]
1. Data input twice 2. The two inputs are compared by computer to ensure they are identical
45
Describe two validation checks that can be carried out on the price of a product [4]
1. Range check. Parameters imposed beyond which the data cannot go e.g. Tin of beans must be between 0.10 and 1.50 2. Length check. The maximum number of characters is specified. Price of a tin of beans must be three characters
46
An airport wishes to allow airlines to be able to access the data it has on flights via the internet. Describe one format or method the airport could use to provide the data to the airlines so they can use it in their own applications. [2]
CSV/Comma Separated Value file can be used which is a text file with values separated by comma.
47
What are 2 differences between a flat file database and a relational database?
1. Flat file database stores all data in a single table, whereas a relational database organises data into multiple tables 2. Flat file database causes redundancy whereas relational database uses keys to connect related data which reduces data redundancy