4 ms·
Without a rigorous attempt at justifying each of these rules, I don't find this article particularly useful. For example, can someone link to or provide a forma
by 0xffff2 9y ago
Without a rigorous attempt at justifying each of these rules, I don't find this article particularly useful. For example, can someone link to or provide a formal explanation for why table names should be singular? I actually really wanted to read the full relational algebra rational for that one.
- davvolun 9y agoI've been through the relational algebra, I found this to be a nice, quick re-cover. More like a checklist than a full inspection.
- zzzeek 9y agoI'm sure this SO answer will satisfy you: https://stackoverflow.com/a/4703155/34549 https://stackoverflow.com/a/4703155/34549
- kbenson 9y agoThat answer satisfied me initially, but less and less so the more I read. It became very obvious by the end that what is being represented is one "standard", but presented as the only possible correct solution. It starts off with Yes. Beware of the heathens. Plural in the table names are a sure sign of someone who has not read any of the standard materials and has no knowledge of database theory. I thought the author was being flippant, but it became increasingly obvious that this is a true reflection of their dogmatic view with regard to this topic. Even if this is the same view I would settle on with all the knowledge, being presented with what is obviously a single perspective with no acknowledgement whatsoever of any positive aspects of alternatives causes me to instinctively distrust quite a bit of the reasoning presented.
- nickpeterson 9y agoperformancedba answers ... the sound and the fury.
- cwbrandsma 9y agoMy own view is they should either be all plural or all singular. Just pick one. But I do gravitate to singular because all nouns have naturally consistent singular words. The same cannot be said of plural. e.g. Moose, Cactus, and any other word that ends in an 's'.
- wvenable 9y agoI used to do all plural but then I read a good argument online for doing singular so I switched to that for the next project and I've done singular ever since. The few advantages of singular: 1. It's not always clear what the plural of something should be. 2. Chances are the singular maps better to your application layer (Person class <=> Person table).
- chias 9y agoThat's a fair point, but keep in mind that the author isn't suggesting these are the "correct" ways to write SQL. They're just his ways. I don't think one standard is necessarily better than another, but the important thing is to have rules. Over the years I've adopted similar rules for myself, and just internal consistency is so much better. I have old projects with table names including: "logs", "log_requests", "log_users", "game_logs", etc., not to mention mixing of plural and singular, to the point where I need to `show tables` before writing any query just to remember what I even called the table I need.
- qilo 9y agoRelation definitions define types. Types have names. Tuple in a relation is an instantiation of the corresponding type. And we use singulars for class/types names in most programming systems (e.g. class Person vs class Persons).