What are entities in the database

Basic concepts
Entity and Attribute


Richard-Wossidlo-Gymnasium Ribnitz-Damgarten
Department of Computer Science



Definitions

Information about objects of interest is stored in a database. These are called entities and can e.g. B. be a person, a subject, an event, a process or a concept.

An entity is a clearly identifiable object or a clearly identifiable state of affairs in the real world or in the world of ideas.

Examples: Karl Meier, Mucki brand children's bike, Karl Meier not being transferred, Zuse Z3 computer

The entity becomes through their Attributes/ Properties determined. The values ​​appearing on a given entity are Attribute values

Entity: Karl Meier;
Attributes: Surname, first name, place of residence, school, class, ...
Attribute values: Meier, Karl, Hohenwulsch, elementary school, 3a, ...

A value only provides a clear statement about the entity property in conjunction with its attribute. An attribute can also have no value at a point in time because it is not known. This value is then referred to as Zero value

Examples: Martin can belong to both the first name and the last name attribute;
a phone number can e.g. B. not be known and therefore be a zero value

Zero values ​​can be represented and object descriptions are absolutely permissible. However, they no longer allow unambiguous data evaluation!

Class formation:

An entity type is an abstract description of a set of entities with the same attributes. The description contains a type name and a set of attributes. An entity is a uniquely identifiable element of the entity type.

Karl Meier could be the entity of the entity type Student. Its surname and first name attributes are evidenced by the values ​​Meier and Karl.

Representations

An entity type is fully described by specifying the name and the attributes. The identifiers of the attributes are placed in brackets after the name of the entity type.

Student (name, place of residence, school, class, ...)

As usual for objects, specific information about the entities is written using dot notation.

Student.Name = Meyer

In the graphic notation in the entity relationship diagram (ER diagram), the entity type is represented as a designated rectangle. Its attributes are i. d. R. through Circles or ellipses that have a connection to the entity type. Alternatively, the representation of the entity type as a class in the UML class diagram is also used.

                               

Special features of attributes:

  • An attribute can be composed. The address consists of various components (zip code, city, street, house number). In this case, the additional attributes are added to the graphic display from the address attribute.
  • There are also attributes that can have multiple values. The subject attribute for a teacher can have one, two or more entries, depending on how many subjects the teacher teaches. Such attributes are framed twice in the graphical representation.
  • Attributes that can be calculated from others are called derived. They are shown with a dashed border.