Flat file- a simple database, consisting of information about a single entity.
Entity- A category of an object, person, event or thing of interest about which data needs to be recorded.
Primary key: something that uniquely identifies a particular record in a relational database.
A second primary key in a database is called a composite key.
Secondary key- An additional/alternate key, which can be use in addition to the primary key to locate specific data.
Relationships between entities:
One-to-one
One-to-many (or many-to-one)
Many-to-many
In terms of a relational databases, data is held in tables (called relations) and the data has a primary key and a foreign key.
Normalisation: a process used to come up with the best possible design for a relational database.
Normalisation accomplishes:
-No redundancy (unnecessary duplicates)
-Consistent data throughout linked tables
-Records that can be added and removed without issues
-Complex queries that can be carried out
1st Normal Form: There must be no attribute that contains more than a single value.
2nd Normal Form: Database must be in 1NF
No partial dependencies (no attribute is dependent on only a portion of the primary key)
Should be functionally dependent on the candidate key.
Flat-file vrs Relational database:
Flat-files may have redundant data whereas Relational database will not
Flat-files are harder to update
Relational databases are easier to change the format
Flat-file doesn't need specialist knowledge to operate
Relational databases provide security features
3rd Normal Form: Fields must be dependent on the primary/composite key (no trasitive dependencies)
Relational databases- a database which creates different tables for different entities.
Indexing- a method used to store the position of each record ordered by a certain attribute. Used to look up and access data quickly through an indexed primary and secondary key.