Relationships
One-to-one
One-to-many
Many-to-many
Primary Key
Unique identifier for a table
Defined underlined
Indexed for quick searching
Secondary Key
Not a unique identifier but something that is searched frequently so is indexed for ease
Foreign Key
Field in a table that is the primary key of another table in the relational database
Defined in italics
Referential integrity
The foreign key in one table must reference the primary key of another table
Normalisation
Finding best possible design for database
Features of normalised database
Easier to maintain
No unnecessary duplication of data
Data integrity
Faster searches
Features of a table in 1NF
All data is atomic
Data within fields are of the same type
Fields have unique names
Features of table in 2NF
All of 1NF
No partial dependencies
Partial dependency
Attribute depends only on a part of a composite key rather than the whole thing
Properties of table in 3NF
All of 2NF
No transitive dependencies
Transitive dependency
Attribute is only dependent on the primary key, not anything else
Methods of capturing data
Manual
Automated
Methods of transferring data
Automatically using DBMS
Using EDI - electronic data interchange -> replaces email/fax
Transaction
Single logical operation on a database
ACID
Atomicity
Consistency
Isolation
Durability
Atomicity
All or none of the transaction is processed
Consistency
Defined rules of the database cannot be violated
Isolation
Concurrent execution of different transaction leads to same result
Durability
Transaction must be processed and saved
Record locking
Prevents simultaneous access to documents
Problem with record locking
Deadlock when two or more processes lock a record the other needs so neither can complete
Timestamp ordering
A transaction can only complete if the most recent open of the database is the same as the user, if not someone else has opened more recently
Redundancy
Back up copy of data, often stored in a different physical location