Databases Flashcards
What does ACID stand for?
A- Atomicity
C - Consistency
I - Isolation
D - Durability
Explain ‘atomicity’
- A transaction over the internet is a result of multiple small interactions
- The transaction can only be complete if all are complete, so a transaction could either be fully complete or not at all
Explain what happens if a transaction ‘aborts’?
If a database ‘aborts’, all actions taken in the transaction until that point are reverted to its original state.
What happens if a transaction ‘commits’?
The transaction goes through successfully
Explain ‘consistency’
- A database must maintain referential integrity rules between linked tables
Explain ‘isolation’
- A transaction must have the same result as if all are being completed one after the other instead of sequentially
Explain ‘durability’
- A completed transaction must ‘survive’ in a database after power loss or crashes.
- Transactions must be conducted in the background and then changes can be made to the database.
What is ‘record locking?’
Where a person editing a database automatically locks it.
This allows others to view the database, but not edit it.
Why is record locking used?
- Prevent loss of updates
- Prevent inconsistencies
What is a ‘deadlock’
Occurs when two people wish to access each other’s records at the same time, but cannot as they have both been locked.
Define ‘primary key’
A unique field that is used to identify records
Define ‘secondary key’
A key that can be used to search for records in a database
Define ‘foreign key’
A field that has a relational link to another table in a database
Define ‘flat-file database’
Database that consists of only one table and multiple records under it
- Typically has a lot of repeating values
Define: ‘Composite key’
A combination of fields that could be used to identify records in a table
What are some disadvantages to flat-file databases?
- Usually contain a lot of repeated records
- Hard to edit and maintain due to human error and referential integrity rules being broken
What is a ‘CSV File’?
Comma Separated Value file
Where data in databases are separated with the use of commas
Define ‘relational database’
A database which uses more than one table to group linked pieces of data together
Tables are linked together via the use of foreign keys
State the criteria required for a database to be normalised to 1NF
- Must contain unique field names
- Values in fields must have the same storage types
- Must only be one value in a field
- Records musn’t be identical/repeated
- Each table must have a primary key