Basic Concepts of Relationships

Table:

Examples are as follows



Domain:

a set of values

For example, a set of integers, a set of students, etc., the number of elements in the set is called the cardinality of the field

D2 in the above picture = women's collection = {Wang Fang, Liu Yu}

The Cartesian product of a set of fields is all possible combinations , such as the Cartesian product in the picture as follows:


Each element (d1, d2, ...) in the Cartesian product is called an n-tuple , where any di is called a component


relation:

a subset of the Cartesian product of a set of fields D1, D2, …, Dn

Those tuples in a Cartesian product that have a certain aspect are called a relation

Example: The first graph is a relationship, and its elements are subsets of the second graph

Relationship Description: Family (husband: man, wife: woman, children: children) or abbreviated as family (husband, wife, children)

The degree of the above relationship is 3, and the description method is also called the relationship schema or table title

The mapping of attributes to domains in the relational schema R (A1:D1, A2:D2,...) is generally directly described as the type, length, etc. of attributes in many DBMSs.

For example Student(S#:char(8), Sname:char(16), Sage:interger, …)

The relationship needs to satisfy the first normal form of the relationship : attributes cannot be subdivided (that is, composite attributes and multi-valued attributes are not allowed )

Examples of composite properties are as follows:



Relationship schema:

The structure of the relationship, the relationship is the data at a certain moment in the relationship schema

In the same relationship mode, there may be many relationships, the relationship mode is stable, and the relationship may change at any time


Post: https://blog.csdn.net/jaihk662/article/details/80066913

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324829918&siteId=291194637