Questions tagged [database-relations]

A relation is a data structure which consists of a heading and an unordered set of tuples which share the same type.

A relation is a data structure which consists of a heading and an unordered set of tuples which share the same type.

When Edgar F. Codd invented the relational model, he generalized the concept of binary relation (mathematical relation) to n-ary relation. Relation is a fundamental concept in relational model.

  • A relation has zero or more tuples.
  • A relation value is an instance of a relation.
  • A relation variable (relvar) is a variable which has a relation value.

In some contexts, relation means relation variable. In other contexts, relation means relation value.

In SQL, a database language for relational databases, a relation variable is called a table. Relational model concepts including relation

A relation value, which is assigned to a certain relation variable, is time-varying. By using a Data Definition Language (DDL), it is able to define relation variables.

  • A heading is the unordered set of certain attributes (columns). A heading has zero or more attributes.
  • A body is the unordered set of tuples, which constitutes a relation value. In other words, a relation value consists of a heading and a body.
  • A tuple is a data structure which consists of the unordered set of zero or more attributes.
  • An attribute (column) is a pair of its attribute name and domain name. Domain can be considered data type, or simply, type.
  • An attribute has an attribute value which conforms to its domain. An attribute value is a scalar value or a more complex structured value.
  • The degree of a relation is the number of attributes which constitute a heading. The degree of a relation value is zero or more integer. An n-ary relation is a relation value in which its degree is n.
  • The cardinality of a relation is the number of tuples which constitutes a relation value. The cardinality of a relation value is zero or more integer.

There are no duplicate tuples in a relation value. A candidate key is a certain minimal set of one or more attributes that can uniquely identify individual tuples in a relation value.

319 questions
-3
votes
1 answer

How to add relationship on same fields of Two tables (Table Order and Table Product) in SQL Server?

Dear anyone can help me as i have two tables named as Order and Products which have more than two multiple same fields i want to make relationship among all same fields in both tables You can see tables in pictures below:
-3
votes
1 answer

How can I relate a model instance to another in django?

I'm trying to relate a model instance to another. For example, If I have a model named Person and I'd like to relate a person to his/her father. How can I do that? I'm not proving a code because there isn't one about this specific question. But the…
-3
votes
1 answer

Need Help on 3 Table Relations Ms access and Vb.Net

I created 3 Tables in ms access in which the Table Person is the only one that contains a Primary key TABLE PERSON(ID,FNAME,MNAME,LNAME) , and i connect it to 2 TABLES AMOUNT(ID,amount,Term ), TABLE TIME(ID,start,due). The time table and id table…
1 2 3
21
22