Relation (database)

Formal basis of the relation in terms of a database relation is the mathematical definition. The relationship is the basis of relational algebra that was developed by Edgar F. Codd. A relation consists of attributes and tuples. An attribute describes the type of a possible attribute value and is denoted by an attribute name. A tuple represents a specific combination of attribute values ​​and is referred to in the database area also called a record.

Relations as tables

In connection with a relational database, it is common to describe a relationship of one table. In tabular form, the attributes correspond to the column headers, the attribute values ​​present in the column entries. A tuple is a row of a table. Often attribute values ​​are incorrectly referred to as an attribute.

Both the context of attributes or attribute values ​​within a table, and a join tables by foreign key, make a relation dar. to errors probably leads the dissemination of terminology of ER models. There, the terms entities ( entities ) and relationships ( Relationships ) are needed. The mistake is to distinguish entities and relationships in principle. In principle, but both entities and relationships are to be regarded as relations. A relationship between two tables is yes with the merging of two relations ultimately only an increase in the number of elements, creating an Considering a relation as a relation, then put their items than the union of the elements of the two linked relations dar.

While ER models can be helpful in the development of a database schema, the relational data model, with its relational algebra is more suitable for the basic structuring of data.

If there were in the database table for every possible combination of attribute values ​​on a separate line, then this table would represent the Cartesian product of the sets of values ​​for the columns. Usually a database table contains only a very small subset of the possible tuples, ie, it represents a subset of this Cartesian product

One consequence of conceiving the assignment of a database table as a set, is that the individual lines are to be regarded as elements of this set. You can thus either in quantity ( table) to be included or not - the number and position of an element you can not talk sense, however. With the normal database query language SQL, it is possible in general, an element (that is, a line with a certain value allocation ) to insert more than once in a table, such an approach, however, is meaningless: Several rows that are given the same values ​​that have the same logical identity and are indistinguishable from each other.

Definition

Many terms are used in the context of relationships, but they often mean the same thing. In addition, there are both German and English names which are further mixed. The following table lists terms used often.

677309
de