[Tutor] Proper SQLite cursor handling?
Roel Schroeven
roel at roelschroeven.net
Wed Jul 7 05:51:37 EDT 2021
Op 7/07/2021 om 1:40 schreef Cameron Simpson:
> Just to this, a normal approach would be a single table with an
> additional game_id column. A specific hand is then identified by the
> (game_id,hand_num) tuple. A whole game would be all hands with a
> particular game_id value.
>
> This is what the "relational" in RDBMS is for - SELECT lets you pull out
> all sorts of things based on these relationships.
>
This is all very helpful; just one small nitpick concerning terminology.
Contrary to what many people believe, and what I used to think before I
took a course on RDBMSs, a relation in the relational model is *not* the
link between tables. A relation in the relational model is what SQL
calls a table: each row is a predicate, and a relation is a set of
predicates belonging to the same predicate variable. As the Wikipedia
article on Database design
(https://en.wikipedia.org/wiki/Database_design#Determining_data_relationships)
says:
"(NOTE: A common misconception is that the relational model
<https://en.wikipedia.org/wiki/Relational_model> is so called because of
the stating of relationships between data elements therein. This is not
true. The relational model is so named because it is based upon the
mathematical structures known as relations
<https://en.wikipedia.org/wiki/Relation_(mathematics)>.) "
See also e.g. the Wikipedia article on the relational model:
https://en.wikipedia.org/wiki/Relational_model)
I know, that all sounds overly formal and mathematical and not terribly
useful, and I don't know the correct name for the link between tables.
Relationship, perhaps, as you said?
Still I think it's important, to avoid needless confusion, to at least
be aware of the official terminology.
--
"Met een spitsvondig citaat bewijs je niets."
-- Voltaire
More information about the Tutor
mailing list