Data Base Flashcards
What is an entity?
An item of interest which information is stored.
What is a relational database?
Is a database which recognises the differences between entities by creating different tables for each entity.
What are attributes?
Are characteristics of the entity.
What is a flat file?
It is a database that consists of a single file. (Based around one entity and it’s attributes)
How are flat files written out?
Entity1(Attribute1, Attribute2, Attribute3…)
What is a primary key?
It is a unique identifier for each record in the table.
What is a foreign key?
It is the attribute which links two tables together. (It will exist in one table as the primary key and act as a foreign key in another)
What is a secondary key?
It allows a data base to be searched quickly.
Entity Relationship modelling
When relating two databases together there are different degrees of relationships they can possess
Entity Relationship Modelling : One to One
Each entity can only be linked to another entity. For example the relationship between a husband and wife. The husband entity can only be associated with one wife entity and vice versa
Entity Relationship Modelling : One to many
One table can be associated with many other tables, such as a mother having multiple children. Similarly, multiple child entities can be linked to the same mother entity.
Entity Relationship Modelling : many to many
One entity can be associated with many other entities and the same applies the other way round. An example is students and courses, each student can enrol in more than one course and each course can have more than one student
Entity Relationship Modelling : one to one demonstration
Demonstrated using a single line to connect two entities.
Entity Relationship Modelling : one to many demonstration
Will have a branch on one side
Entity Relationship Modelling : many to many demonstration
Has branches on both sides