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