1.3.2 Databases Flashcards
Whats a database?
An organised collection of related data
What’s a flat file database?
A database in 0NF, where all data is stored in a single table, about a single entity. It’s useful for static (non-changing) data
What’s an entity
A category about which data needs to be recorded e.g. a person, or thing. (A table in the conceptional phase)
What’s a table
A Two-dimensional representation of data that is stored in rows and columns
What’s a field
A single piece of data about an entity
What’s a record?
A group of fields about a specific entity (AKA a row)
What’s a relational database?
Where data is held in multiple tables that are linked via relationships.
What’s a primary key?
A field used to uniquely identify each record in the table
What’s a feature of a primary key field?
It’s automatically indexed
What’s a composite primary key
When multiple fields are used to uniquely identify each record in the table
What are the three types of relationships between entities?
One-to-one,
One-to-many,
Many-to-many
What’s a foreign key?
A field that creates a relationship between two tables, appearing as the primary key in another table.
What are the benefits of foreign keys?
They maintain the relationship between tables
Why do we use junction tables?
To eliminate many-to-many relationships
What are junction tables?
A junction table contains the primary key columns of the two or more tables you want to relate.