1.3.2 Databases Flashcards
relational database
based on linked tables to avoid data duplication, inconsistency, redundancy and improving data integrity and security
Flat file database
database that consists of a single file
cons of flat file databases
it can be very inefficient due to data redundancy, it is difficult to query and takes up unnecessary space
primary key
a unique identifier for each record in the table, each row of the primary key must be different
foreign key
it is the attribute that links two tables together, it exists in one table as the primary key and acts as a foreign key in another
secondary key
allows a database to be searched quickly, but typically does not uniquely identify a record with complete accuracy. For if you want to find a student in a database you would probably search for their name so the secondary key/index would be the NAME field
ACID
Atomicity, Consistency, Isolation and Durability
Atomicity
A transaction should either be completely transformed or not at all. A half completed change must not be saved back to the database
Consistency
each transaction must obey the defined validation rules of the database, to maintain referential integrity
isolation
A transaction must not be interrupted by another transaction. The transaction must occur in isolation so other user or processes cannot access the data concerned
Durability
once a transaction has begun, it must be completed under all circumstances
referential integrity
the idea of keeping a database consistent by ensuring that changes made to data with a table are accounted for in all linked tables
Normalisation
The formal process of optimally designing data tables by reducing redundancy and repetition by converting them into normal forms
First normal form (1NF)
- All fields must be unique/different
- values in fields must be the same domain/data type
- Values in fields should be atomic ( contains one value )
- No two records should be identical
- each table needs a primary key
composite key
Two or more primary keys used in a table that can uniquely identify each record