Entity¶
An entity is an object that: * has attributes that confirm its existence * is differentiable from every other entity in some way
Entity Set¶
An entity set is a set of entitites that share the same attributes * For example, a table containing all employees and their attributes is an entity set.
Attribute¶
An attribute is a value that tells us something noteworthy about the entity that it belongs to
Primary Key¶
A primary key is a special attribute, that helps us uniquely identify each member of the identity set. Think of it as an ID card
Example¶
In the Battling Civilisations videogame, one enters a stage (one of many, with their own distinct designs) with their army. Both the player's and foe's armies contain soldiers, who carry weapons. While traversing the stage, one has to watch out for traps set by the enemy's civilisation
The entities identifiable in this extract are: * Stage * Civilisation * Army * Soldier * Weapon (another Weak Entity) * Trap
The identification of an entity in E-R Database Design is very similar to the identification of a class in Object Oriented Design
Representation of an Entity¶
- A rectangle represents the collective attributes of an entity set
- The title of the entity is present in the header
- Attributes are present in the body
- The Primary Key is underlined