Post by Uncle Buddy on Aug 19, 2022 20:57:57 GMT -8
Cardinality in database design refers to whether a relationship between data is one-to-one, one-to-many, or many-to-many. As far as I know, it's impossible to get the right stuff in and out of the database when needed if cardinality is not right. For a one-to-one relationship, the data would normally be two columns in the same database table. For one-to-many, the foreign key of the one side would be a column in the many side. For many-to-many, both sides will be represented by foreign keys in a junction table. This is my understanding of the situation. The rules posted below were gotten wrong more than once, some of them, and this is my current understanding.
The repository dialog is finished for now. I recorded 31 videos of myself writing this code, eight of which will not be used. It will take a few days to get the videos uploaded to the rumble.com channel.
CARDINALITY LAWS OF ASSERTION, SOURCE, CITATION, AND REPOSITORY
# source:citation is one-to-many relationship so source_id is FK in citation table;
# citation:assertion is 1:m so citation_id FK is in assertion table;
# repo:contact is m:m so repo & contact are linked in links_links; USE THIS ONLY IN CONTACTS TAB, NOT IN REPO DIALOG
# repo:locators is one:many, so repo is FK in locator;
# citation:locator is one:many, so citation_id is FK in locator FOR EXAMPLE: there can be multiple pairings of one citation with different locators, and a third column in the same table is needed because there is a 1:1 rel btwn this pairing and one repository so the whole picture is gotten from these 3 cols in locator table: locators, repo_id, citation_id
# each source can be in many repos and each repo can contain many sources, so sources and repos are m:m and linked in links_links
The repository dialog is finished for now. I recorded 31 videos of myself writing this code, eight of which will not be used. It will take a few days to get the videos uploaded to the rumble.com channel.
CARDINALITY LAWS OF ASSERTION, SOURCE, CITATION, AND REPOSITORY
# source:citation is one-to-many relationship so source_id is FK in citation table;
# citation:assertion is 1:m so citation_id FK is in assertion table;
# repo:contact is m:m so repo & contact are linked in links_links; USE THIS ONLY IN CONTACTS TAB, NOT IN REPO DIALOG
# repo:locators is one:many, so repo is FK in locator;
# citation:locator is one:many, so citation_id is FK in locator FOR EXAMPLE: there can be multiple pairings of one citation with different locators, and a third column in the same table is needed because there is a 1:1 rel btwn this pairing and one repository so the whole picture is gotten from these 3 cols in locator table: locators, repo_id, citation_id
# each source can be in many repos and each repo can contain many sources, so sources and repos are m:m and linked in links_links