| advertise add site services publishers database health videos | ![]() | about toolbar stats live show health store more stuff JOIN/LOGIN |
In relational model:
In some context, relation means relation variable. In another context, 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.
There are no duplicate tuples in a relation value. The certain minimal set of one or more attributes can identify individual tuples in a relation value. Such an attribute set is called as a candidate key.
[edit] ExamplesThe following is an example of a heading which consists of three attributes.
The following is an example of a relation value which consists of the above heading and tuples (rows) which conform to the heading. This example shows a relation value in visual table form for the sake of convenience.
The above relation value includes four tuples which share the same type. As mentioned above, the attributes are unordered. In other words, it is wrong to say "Address is on Name's right." and it is also wrong to say "Address is the third attribute." As mentioned above too, the tuples are unordered. In other words, it is wrong to say "The tuple of 'MURATA Makoto' is above the tuple of 'MATSUMOTO Yukihiro'" and it is also wrong to say "The tuple of 'YONEZAWA Akinori' is the first tuple." [edit] Base relation variable and derived relation variable (view)Relation variables (relvars) are classified into the two classes, which are base relation variable and derived relation variable. By applying a relational algebra expression or relational calculus expression to one or more relation variable, one new relation value is derived. A base relation variable is a source relation variable which is not derived from any other relation variables. In SQL, a database language of relational database, the term base table can be roughly considered base relation variable. By using a Data Definition Language (DDL), it is able to define base relation variables. In SQL, by using CREATE TABLE List_of_people ( ID INTEGER, Name CHAR(40), Address CHAR(200), PRIMARY KEY (ID) ) A derived relation variable is a relation variable which is derived from one ore more relation variables by applying a relational algebra expression or relational calculus expression. View is considered derived relation variable. By using a Data Definition Language (DDL), it is able to define derived relation variables. In SQL, by using CREATE VIEW List_of_Okinawa_people AS ( SELECT ID, Name, Address FROM List_of_people WHERE Address LIKE '%, Okinawa' ) [edit] See also
[edit] References
| |||||||||||||||||||||||||||||||||||||||||
| ↑ top of page ↑ | about thumbshots |