Timeline for Best practice for SQL table names when using sub namespaces that exceed maximum table name length
Current License: CC BY-SA 4.0
21 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 11 at 3:02 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
May 13 at 14:05 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jan 13 at 12:05 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Sep 5, 2023 at 23:00 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
May 5, 2023 at 23:01 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Dec 23, 2022 at 18:08 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Aug 19, 2022 at 22:04 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jan 20, 2022 at 17:40 | answer | added | Rick James | timeline score: 0 | |
Jan 20, 2022 at 15:54 | history | edited | Arya | CC BY-SA 4.0 |
Added reference to another related post regarding the use of abbreviated names.
|
Jan 20, 2022 at 15:49 | comment | added | Vérace |
lh_domain (life hierarchy domain) is a parent to lh_kingdom which in turn is parent to lh_phylum - chose as many letters as you need for lh - even the full life_hierarchy_xyz... would do it - class, order... and so on down the line? No?
|
|
Jan 20, 2022 at 15:46 | history | edited | Arya | CC BY-SA 4.0 |
deleted 24 characters in body
|
Jan 20, 2022 at 15:45 | comment | added | Arya |
@J.D. Naming the table according to the direct object(s) is practical for some objects, but not all object. For example, a table named species is practical, but a table named class is not practical because it is also used in the school namespace (e.g., school_program_class )
|
|
Jan 20, 2022 at 15:40 | comment | added | Arya |
@MichaelKutz The problem with just class or order is that they are ambiguous, because the database includes those words as its sub names, such as school_program_class .
|
|
Jan 20, 2022 at 15:38 | comment | added | Arya |
@Vérace-getVACCINATEDNOW. Thank you for pointing out the Linnean system. I now notice the redundancy of life_ . Abbreviating may be confused with other names in the namespace that also have first characters as d and p . I just updated my question to include examples of those names.
|
|
Jan 20, 2022 at 15:33 | history | edited | Arya | CC BY-SA 4.0 |
added 507 characters in body
|
Jan 20, 2022 at 13:24 | comment | added | Bill Karwin |
You may be interested in the public taxonomy data from itis.gov which stores all those entities in one table named hierarchy .
|
|
Jan 20, 2022 at 13:11 | comment | added | J.D. |
As pointed out by Michael, you should name a table after the direct object(s) it's data represents, regardless of where that object lives in the hierarchy of entities. Your table life_domain_kingdom_phylum_class_order_family_genus_species doesn't directly store all of the lifes , nor all of the kingdoms, nor all of the phylums, etc. It directly stored species so it should just be called species and it's foreign key relationship to it's parent entity genus (another table) should exist and explicitly define the hierarchy.
|
|
Jan 20, 2022 at 10:00 | comment | added | Michael Kutz |
What's wrong with just phylum , class order , etc.? You have FKs that enforce the relationship. I can see a grouping (by different life groups) like worldbuilder_stackexchange_genus vs real_species
|
|
Jan 20, 2022 at 6:51 | comment | added | Vérace |
Surely those who are writing queries for this database are familiar with the Linnean system and biology in general? The life_ bit appears to be redundant. Have d_k_p as an abbreviation for domain_kindom_phylum - that should give you all the space you need? I would suggest that this is a better solution than having tables name ifuel9kf03l !
|
|
Jan 20, 2022 at 6:48 | history | edited | Arya | CC BY-SA 4.0 |
renamed title
|
Jan 20, 2022 at 6:29 | history | asked | Arya | CC BY-SA 4.0 |