6 ms·
> A Table is a superset of a Relation. Subset. You can build relations on top of tables, but not tables on top of relations. SQL falls short of the mathematica
by randomdata 3y ago
> A Table is a superset of a Relation.
Subset. You can build relations on top of tables, but not tables on top of relations. SQL falls short of the mathematical model. As it pertains to the topic at hand, whether or not that is significant is not something we have tried very hard to prove in practice.
- rramadass 3y agoNot quite true - https://en.wikipedia.org/wiki/Table_(database)#Tables_versus_relations https://en.wikipedia.org/wiki/Table_(database)#Tables_versus... A Table is a Relation encoded as a set of tuples resulting from the cartesian product of values from multiple sets each of which is from a domain. Tables are a weaker form of Relations and hence a superset except for the "ordering" characteristic when it can be considered a subset.
- randomdata 3y ago> multiple sets Right. As before, you cannot build a table on top of a relation. You can build a relation on top of a table, though. > Tables are a weaker form of Relations Yes, exactly, hence it being a subset.
- rramadass 3y ago> you cannot build a table on top of a relation Of course you can; it is in the very definition of the Table which is a manifestation of a Relation. Relationships (which can also be mathematical Relations) across Tables/Views are a different thing. > hence it being a subset. No, all Relations are Tables but not all Tables are Relations because of ordering, duplicates, nulls.
- deleted 3y ago[deleted]
- randomdata 3y ago> Of course you can; it is in the very definition of the Table which is a manifestation of a Relation. You said multiple relations earlier, which is what the comment was in reply to. Why the fliply-flopping? > Relationships Relation, not relations, not relationships. The struggle is real. > all Relations are Tables Yes, that's right, a relation is a table with additional constraints – a superset. Although not a strict superset as it does not carry ordering forward.
- rramadass 3y agoYou seem to be confused between the mathematical definition of a Relation and the English usage of the word "Relation". > You said multiple relations earlier, which is what the comment was in reply to. Why the fliply-flopping? Read my definition above again; I said "multiple sets" and NOT "multiple relations" which is a very different thing. You understood it wrong. > Relation, not relations, not relationships. The struggle is real. Only for you. I have been very clear in the usage of my terms above. A Table encodes a Relation. Additionally, when you do a JOIN across Tables you are manifesting a "Relationship" (English usage) which may/may not result in a Mathematical Relation. > a relation is a table with additional constraints – a superset. No, If there are additional constraints on set A than on set B then A cannot be a superset of B but a subset.