Talk:Relation (database)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Databases / Computer science   
WikiProject icon This article is within the scope of WikiProject Databases, a collaborative effort to improve the coverage of database related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 ???  This article has not yet received a rating on the project's quality scale.
 ???  This article has not yet received a rating on the project's importance scale.
Taskforce icon
This article is supported by WikiProject Computer science.

Tuple: Ordered or Unordered?[edit]

According to the definition of tuple it is ordered, but the definition on this page has them as unordered. Are these different concepts or is one of the pages (probably this one) incorrect? Tweisbach (talk) 10:13, 16 December 2009 (UTC)

It is not an error. They are two distinct related concepts with the same name (I agree that this is a little confusing). See Tuple - Relational model. --MaD70 (talk) 23:04, 2 January 2010 (UTC)

I tried to address this comment in my major revision of October 4th, 2013. AndrewWarden (talk) 17:32, 4 October 2013 (UTC)

Tupple (misspelling)[edit]

The relational-model graphic contains text with the misspelled word "tupple". Will someone with the right software fix it and then delete this talk section? Thanks. Another Stickler (talk) 08:09, 13 March 2010 (UTC)

I fixed the graphic. Thanks. --AutumnSnow (talk) 16:01, 27 March 2011 (UTC)

Possibly erronous information in the definition[edit]

  • A tuple is a data structure which consists of the unordered set of zero or more attributes.

- seems zero or more attribute values (header contains attributes, tuple their values).

  • The degree of a relation is the number of attributes which constitute a heading.

- the 'degree' points to 'comparative' which seems make no sense here; I suppose correct is 'arity'.

JerzyTarasiuk (talk) 00:00, 18 June 2011 (UTC)

I tried to address this comment in my major revision of October 4th, 2013.

AndrewWarden (talk) 17:34, 4 October 2013 (UTC)

Tuple - answer to the query about ordering[edit]

From Relation_(database): E.F. Codd originally defined tuples using this mathematical definition. Later, it was one of E.F. Codd's great insights that using attribute names instead of an ordering would be so much more convenient

So, while tuple in math is ordered, in a relational database it is an unordered entity.

JerzyTarasiuk (talk) 00:07, 18 June 2011 (UTC)

Comprehension level[edit]

Sorry, but I don't get any of this. It's not even clear whether a "relation" is a table (information) - or table (database). --Uncle Ed (talk) 05:06, 8 January 2012 (UTC)

Neither. As correctly specified in Table_(database)#Tables_versus_relations: "a table can be considered a convenient representation of a relation, but the two are not strictly equivalent". So to characterize a relation as "a data structure such as a table" is misleading and reinforces the confusion between the logical concept and its representation. For example, when one represents a relation as a table is forced to give an order to attributes, represented as columns, and tuples, represented as rows. Anyway I agree that the first part of this article needs a rewrite. --MaD70 (talk) 01:28, 14 January 2012 (UTC)

I'm working to a rewrite. Below a draft to show how I want to formulate it. Deleted mentions of Data structure because relations and tuples are Abstract data types, they can be implementd in various ways.

A relation, in the context of relational data model due to Edgar F. Codd, is a term often used loosely to indicate indifferently a type constructor (or type generator), a relation type, a relation variable or a relation value, depending by context.
== Preliminary definitions ==
An attribute (loosely, a column) is an <attribute name, type name> pair.
A heading is set of attributes; within any given heading, distinct attributes are allowed to have the same type name but not the same attribute name. Every subset of a heading is itself a heading.
The degree of a heading is the number of its attributes.

And so on... I will refer to The Relational Database Dictionary, Extended Edition, by Christopher J. Date. --MaD70 (talk) 03:08, 14 January 2012 (UTC)

I tried to address all these comments in my major revision of October 4th, 2013. I also found and corrected a number of additional errors and infelicities.

AndrewWarden (talk) 17:34, 4 October 2013 (UTC)

Can we have a specific reference for the claim that 'there is no ordering to the elements of the tuples of a relation' please? If we're going to contradict the reference from Codd we should have a reference to back up our contradiction.- Crosbie 18:49, 4 October 2013 (UTC)
In addition to the 1972 Codd reference, Ramez Elmasri and Shamkant Navathe state the following, in the 2003 edition of Fundamentals of Database Systems : A relation (or relation state) r of the relation schema R(A1,A2,...An), also denoted by r(R), is a set of n-tuples r = {t1, t2,...,tn}. Each n-tuple t is an ordered list of n values t = <v1, v2,...,vn>, where each value vi, 1 ≤ in, is an element of dom(Ai) or is a special null value. (Elmasri, Ramez and Navathe, Shamkant B. (July 2003). Fundamentals of Database Systems, Fourth Edition. Pearson. p. 128. ISBN 0321204484.  ) - Crosbie 19:59, 4 October 2013 (UTC)
Well, one could cite Codd's The Relational Model for Database management, Version 2 (Addison-Wesley, 1990), ISBN 0-201-14192-2, page 3. Codd created confusion in his early papers by stating that the attributes are ordered but devising an algebra that had no dependence on such an ordering, using attribute names instead of referring to the by position. There is of course no point in defining an ordering that has no significance, and one of Codd's clearly stated motivations was what he called "data independence", such that application programs were free from having to "remember" the order of the fields on a record and undergo "unprductive maintenance" when data structures were changed.
I understand that Elmasri et al.'s account assumes that every relation has a name in addition to heading and body, also that attributes can have more than one name, such as A and R.A. This notion doesn't really stand up to close scrutiny. One might also reference P..V. Hall, P. Hitchocock, and S.J.P. Todd, "An Algebra of Relations for Machine Computation" in the Conf. Record of the 2nd ACM Composium on Principles of Programming Languages, Palo Alto, California (January 1975), which effectively cleaned up Codd's algebra and filled in the one glaring hole in it by proposing the operator that became known as extension.
AndrewWarden (talk) 11:29, 5 October 2013 (UTC)
Can you suggest a quote from Codd 92? I looked over it last night and I have looked over it before, and he clearly disapproves of 'positional concepts'. On the other hand, I could find no clear written definition of a relation in that book. As a reader of Wikipedia it is very frustrating to come across a definition of a term which cannot be traced back straightforwardly to a definition from a good authority, especially when there are competing definitions to be found. That is why I added the Codd '72 definition to the text originally - it is a clear, unambiguous definition of 'relation' which I could paraphrase without risking any change of meaning. I found Codd 92 very hard to use in this way. We we have clear, unambiguous statements from two good published authorities saying that the elements of a relation are ordered. As the text stands we are claiming on no authority that Codd '72 was wrong. Looking at page 3 of Codd '92, I can see nothing I can use to back this up, except by putting my own interpretation on the text. - Crosbie 13:09, 5 October 2013 (UTC)
I agree that Codd's writing is often unclear. Even his famous 1970 paper is rather muddled in some respects. His failure to distinguish clearly between "attribute" and "domain", for example, caused a lot of confusion and anguish in those early days. His 1990 book is quite dreadful in some people's opinion (including mine). Anyway, I've provided the best quote I could find, plus a clear, precise one from Date.
AndrewWarden (talk) 13:22, 5 October 2013 (UTC)