It’s an English literacy thing - we have several non-native English speakers and using only singular avoids making those folks’ lives harder. Besides it’s really nice to autopilot that categoryid is a foreign key to the category table. It also simplifies always plural words… I haven’t yet written CREATE TABLE pants but if I ever do there’s zero chance of me creating a pantid.
I tend to use underscores on join tables so table foo_bar would have a fooid and a barid. I have somewhat soured on this approach though since there are a lot of situations where you’ll have two m-m relationships between the same two tables with a different meaning… and having a fixed formula for m-m tables can make things ugly.
If I get to design another greenfield database I’ll probably prefer using underscores for word boundaries in long table names.
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
Posts must be relevant to programming, programmers, or computer science.
No NSFW content.
Jokes must be in good taste. No hate speech, bigotry, etc.
It’s an English literacy thing - we have several non-native English speakers and using only singular avoids making those folks’ lives harder. Besides it’s really nice to autopilot that
categoryid
is a foreign key to thecategory
table. It also simplifies always plural words… I haven’t yet writtenCREATE TABLE pants
but if I ever do there’s zero chance of me creating apantid
.no underscores either? What are we, apes?
I tend to use underscores on join tables so table
foo_bar
would have a fooid and a barid. I have somewhat soured on this approach though since there are a lot of situations where you’ll have two m-m relationships between the same two tables with a different meaning… and having a fixed formula for m-m tables can make things ugly.If I get to design another greenfield database I’ll probably prefer using underscores for word boundaries in long table names.
I always thought they should be singular to be closer to the names we give entities and relations in a entity-relation diagram.
That too, singular table names just makes a lot of stuff more automatic.