6

I'm not asking what a relational database is. I'm asking what relational data is. What makes data relational? What are some examples of relational data and of non-relational data that illustrate the difference?


Edit: I now understand that there isn't anything "relational" about the data itself, and that there are advantages to representing certain data sets relationally.

Even if the question is malformed, I think that a lot of other people might have the same question, want to know the answer, google it etc. So I think it'd be useful if they come across this.

Adam Zerner
  • 17,797
  • 15
  • 90
  • 156
  • @Panther your comment is not constructive. Googling very often brings people to SO and it can be cleared up here for people with the question in the future. – t3dodson Jul 14 '15 at 04:30
  • My mistake. however this question seems very broad for this forum – Panther Jul 14 '15 at 04:34
  • 1
    All data is relational in the mathematical sense, I consider the terms synonymous. – reaanb Jul 14 '15 at 09:35
  • Data is relational to the extent that it is a collection of relations (with no duplicate or ordered columns or rows) each holding the rows that satisfy its given condition. Codd 1970: "The relation depicted is called *component*. [...] The meaning of *component* (*x*,*y*,*z*) is that part *x* is an immediate component (or subassembly) of part *y*, and *z* units of part *x* are needed to assemble one unit of part *y*". Versus all others: int, string, array, record, list, etc. These (& relations) can be values in rows. But how collections of them represent an application situation is ad hoc. – philipxy Jul 15 '15 at 08:17
  • @philipxy I realize that not everything in mathematics can be represented by relations. How do you define data? To me it means the true and/or false domains of a predicate. – reaanb Jul 15 '15 at 10:29
  • @reaanb 1. I agree that "data" is vague. I don't expect it to mean much more than "records". But I don't know what you are trying to express by "relational in the mathematical sense", or by "all data is" that , or by "the true and/or false domains of a predicate", or by "data is" that. 2. Re "all data is relational": Storing data as relations holding extensions of predicates *is due to* Codd's relational model of data for large shared databases (ie for generic manipulation). Prior to that and outside of that, data was/is structured and manipulated in other & application-specifiic ways. – philipxy Jul 15 '15 at 22:48
  • @philipxy What I'm saying is that relations as defined in set theory are capable of expressing any set of facts (aka data), and that this is independent of its representation in data structures like tables, graphs, nested sets or dictionaries. – reaanb Jul 16 '15 at 13:35
  • [This](https://medium.com/@adamzerner/what-is-relational-data-81c1904948) is the article I wrote in my attempt to answer the question. Any comments would be very welcomed. As for this question it seems that it should be deleted. – Adam Zerner Jul 16 '15 at 14:09
  • 2
    @Adam, cannot comment over there, so commenting here. You suffer from the common confusion that conflates relationSHIPS (as per ER) with relationS (as per Codd /RM). The two have nothing to do with each other and are totally distinct. RelationSHIPS can equally well be represented as relations in a relational system, as they can be represented by nonrelational structures in a graph-based system. And relationS as per Codd/RM are not limited to representing relationSHIPS. – Erwin Smout Jul 16 '15 at 14:36
  • 1
    @reaanb As I explained in my last comment, you are begging the question. "Data" is just some (in general, structured) values. It *represents* something. (Hence we say that a data structure('s value) represents a value or fact.) The data is not the fact. *Your* expressed notion of "data" *assumes* the *relational* model of data. Pre-relational DBMSs and non-relational programs manipulate data, but not by assuming it is only a collection of relations of rows of values satisfying predicates. (For which see Hoare's class & straightforward 1976 "Proof of correctness of data representations".) – philipxy Jul 16 '15 at 21:26
  • I couldn't find a free copy of Hoare's paper - if you have a link, I'm interested. I'll accept the representational meaning of data since it's in common use, in addition to the logical meaning which is the context of my statement and how it's used historically and mathematically. Relations however are not just collections of rows, but subsets of the product of a collection of domains, and every data structure represents a relation since every data structure has a state space which can be described in terms of its variables. DBMSs before Codd still related values, just not as flexibly. – reaanb Jul 16 '15 at 23:38
  • @reaanb Re "link": I've no link. But google "abstraction function" & "representation invariant". Re "every data structure represents a relation": *Represents* a *tuple* (not relation). But in the relational model every data structure *is* (a tuple of) *relations*. (The tuple satisfies the predicate that they're extensions of theirs.) The question was relational vs non-relational data, not interpretations of data. Moreover, non-relation data structures are usually *not* interpreted relationally but as abstract state via an abstraction function. "Relational data" just doesn't mean just "data". – philipxy Jul 17 '15 at 01:34
  • @AdamZerner Everyday language has 'relationship' aka 'association'. In math, '(everyday) relation'. In math, one is represented by an ordered-tuple set, (hence) '(formal) relation'. In the relatiional model, one is represented by an attributed-tuple analogue, (hence) also a 'relation'. In ER, as correctlly presented, 'relationship' has the everyday meaning and one is represented by a relational relation. But incorrect presentations, derivatives and products frequently use 'relationship' to mean 'foreign key constraint' (ie relationship relation FK referencing entity relation PK), a fact. – philipxy Jul 17 '15 at 02:20

1 Answers1

6

"Relational data" is poor terminology used to indicate that the data is managed by a "relational" DBMS. "relational" is not a characteristic of the data per se and so the term per se is, essentially, a hopeless misnomer. If you hear someone use it, take it as a serious indicator/alarm that the person in question actually doesn't have a clue.

Also note that truly relational DBMS's actually do not exist (not in the industrial scene) and the closest approximation to a "relational" DBMS is SQL DBMS's like DB2, Oracle, SQL Server, PostgreSQL, ... but that "approximation" is a quite distant one.

Erwin Smout
  • 18,113
  • 4
  • 33
  • 52
  • When 'the data is managed by a "relational" DBMS" ', which manages relations of rows satisfying predicates, then the data is relations of rows satisfying predicates. So it seems pretty reasonable to say that 'relational data' is 'relations of rows satisfying predicates'. I understand that that doesn't limit 'relational' to the data per se because it includes context, but it's certainly a reasonable use of an adjective. – philipxy Jul 17 '15 at 01:47
  • 2
    Perhaps your English linguistics are better than mine. But adjectives in language primarily serve the purpose of describing characteristics of the object indicated by the noun. "Relational" is not a characteristic of "data" per se. Which you confirmed. And which is why I said it is poor terminology, aka poor use of language. LIkewise, one doesn't say "green mower" to imply the grass is green, one says "green mower" to imply that the mower is green. – Erwin Smout Jul 17 '15 at 06:12
  • Adjectives frequently restrict a class to a context and not a property of. Full bottle: bottle filled with stuff. (Yes, also full bottle-plus-some-stuff-inside.) Occupied seat: seat that a person is in. Red circle: red circular thing. French toast: not even toast. – philipxy Jul 17 '15 at 07:12