Entity Relationship Modelling

4.10.2 (17 questions). Public Notes: AQA's A Level Computer Science

Define entity.

A category of object, person, event or a thing of interest about which data must be recorded.

Define relation.

An category of object, person, event or thing of interest about which data must be recorded in a relation database.

Define attribute.

The category of information which occupies one column in a table.

Define record.

A set of data about one object, person or thing holding all the attributes - a row in a table.

Define field.

One unit of data within a record, corresponding to one attribute.

Describe the structure of a database.

Each relation is represented by a table, each field in each column corresponds to one attribute. The set of fields in each row is one record. There are multiple relations in a database.

Define identifier.

The name of an attribute

Define primary key.

The name of attribute which uniquely identifies a record.

Define composite primary key.

Two or more attributes are all required to uniquely identify a record.

Define Foreign key.

An attribute that is primary key of one relation which is present in another relation, in order to create a join between two relations.

Example of an entity description.

Customer (CustID, title, firstname, surname, email)

What does an underline signify in an entity description?

The primary key(s).

What does either italics or an overline signify in an entity description?

A foreign key.

In a relational database what types of relationships may exist.

One-to-one, One-to-many, Many-to-many

Draw each type of join which may exist in a relational database.

Remember that crows’ feet are drawn on the many side of the relationship.

Why are many-to-many relationships avoided.

Creates sets of repeating data.

How should you resolve many-to-many relationships?

  1. Create a link table with an one-to-many relationship with both relations previously in the many-to-many relationship.
  2. The many-side of both relationships should be at the link table.
  3. The link table should contain the primary key(s) of both relations in the obsolete many-to-many relationship.