(P2) Fundamentals of Databases Flashcards
What is a primary key?
Primary key is a field that uniquely idnetifies each record in a table.
What is a composite key?
Composite key is a specific type of primary key that uses the contents of two or more fields from a table to create a unique value.
What is a surrogate key?
Surrogate key is when a table does not have a naturally occurring primarg key and so a new field is created and the surrogate key acts as a primary key.
What is a foreign key?
Foreign key is a field that is linked to anothet table’s primary key in a relationship between two tables.
What is an entity?
An object, person or thing of interest, which data is stored about.
What is an attribute?
Characteristic or information about an entity.
What is entity identifier?
An attribute given to each entity which is unique within that table.
How is a primary shown?
Underline.
For which relationship does a new table need to be created?
Many to many.
What is the new table for a many to many relationship called?
Link table.
Why are databases normalised?
So they can be efficient without any compromise to the integrity of their data.
What does database normalisation ensure?
There is no redundant or repeated data.
What are the advantages of database normalisation?
Faster searching and sorting than an unnormalised database due to it being smaller.
Easier to maintain.
Duplication of data is minimised and data consistency is improved, reducing the number of update, insertion and deletion anomalies.
What is the first normal form?
Contains no repeating attributes.
Database can be referred to as atomic (no single column contains more than one value).
What is second normal form?
Meet first normal form requirements.
Partial key dependencies are removed.