Databases Flashcards
What is a relational database?
A relational database is a database where data is stored in tables.
What is an attribute?
An attribute is a column in a relational database. Each attribute can have its own data type.
What is a primary key?
A primary key is an attribute, or set of attributes, that will allow an entity to be identified unambiguously. A primary key must be unique.
What is a composite primary key?
The term for a primary key made up of multiple attributes.
What is a foreign key?
A foreign key is the primary key field of one table, that is stored in another table for the purpose of creating a link between the tables.
What is database normalisation?
Normalisation is a technique used to help reduce data duplication when designing data structures.
Describe a database in 1NF
- Each record has a primary key
- Data is atomic (1 value per column)
- No repeating groups of attributes
Describe a database in 2NF
-No partial dependencies (A dependency based on only a part of a composite primary key)
Describe a database in 3NF
No non-key dependencies (no fields are dependent on other fields that are not part of the key)
Why are databases normalised?
Databases are normalised to help reduce data duplication when designing data structures, also resulting in an improvement in data integrity.