Skip to main content
2 of 3
added 34 characters in body
Kevin
  • 30.1k
  • 1
  • 32
  • 41

I'm assuming that this is supposed to be for things related to set theory, but the actual uses of the tag seem to be more in line with MVC-like model relations - which is what the relationships tag is for [...]

Nope, that's not quite right.

In both set theory and database theory, a "relation" is a "bag" or set of n-tuples for some fixed number n (e.g. a binary relation has n = 2). You might also visualize it as a table with no repeated rows, or as a subset of the Cartesian product. These definitions are all describing the same thing, just with different words. SQL calls these things "tables."

A relationship, on on the other hand, is a database theory term for a specific kind of binary relation (i.e. a relation whose rows are all 2-tuples) that indicates connections between the rows of other relations, rather than storing "data in its own right." Pure set theory doesn't have as much need for doing this sort of thing, so "relationship" is solely a database term. In practice, these are usually implemented either as foreign key constraints (one-to-one, one-to-many) or as join tables (many-to-many).

So.

We should make sure that has questions about relations (tables) in any database system, MVC or otherwise, and that has questions about relationships (foreign keys and join tables).

Kevin
  • 30.1k
  • 1
  • 32
  • 41