1.3.2 DATABASES Flashcards
Define entity
an item of interest about which information is stored.
Relational database
A database which recognizes the differences between entities by creating different tables for each entity.
Flat file
A database that consists of a single file. Will most likely be based around a single entity and its attributes. Typically listed like:
ENTITY(Attribute1,Attribute2,…)
Primary key
A unique identifier for each record in the table.
Foreign key
The attribute which links two tables together. Will exist in one table as the primary key and act as the foreign key in another.
Secondary key
Allows a database to be searched quickly. It is an alterative way to find or sort data, not using the main primary key. Helps to locate records when the primary key isn’t known, sort data differently, or ensure uniqueness like email addresses.
ONE-TO-ONE ENTITY MODELLING
ONE-TO-ONE: each entity canbe liked to one other entity, such as the relationship between a husband and wife (NO POLYAMORY, NO CHEATING). The husband can ONLY BE ASSOCIATED WITH ONE WIFE (forget about arabs) and vice versa.
ONE-TO-MANY ENTITY MODELLING
One table can be assorted with many other tables, like an arabic man having multiple wives but each wife only has one husband. Multiple wife entities can be linked to the same arab husband.
MANY-TO-MANY ENTITY MODELLING
One entity can be associated with many other entities and the same applies the other way around. For example people living in a post-modern, socially liberal world who are all polyamorous. Everyone has many different partners.