Singular vs. plural table names

Is it better to name SQL tables with singular or plural names? In my opinion, the most important thing to do is pick one and stick to it. Programmers will always argue about singular vs. plural, and it is possible to make a valid case for both.

My strong preference is singular. The name is the table name; it is not the name of the tuples. A bag does not become a “bags” when you put apples in it. It is still a bag.

You might take this to extremes and reply,

According to that argument, every table should be named “table,” right? If you are naming the table and not the tuples, every table should have the same name. So the table should be named after the contents, and should be plural.

There is such a strong argument for either side, I don’t think you can appeal to logic to solve the problem. That’s why, even though I gave my reasons for preferring singular above, when I actually get into this discussion, I simply say “there are good reasons for either side, but I just like singular names better.” That way nobody can argue with me, because they’re just arguing with my taste, not facts. It’s hard to argue with taste without sounding immature, but it’s easy to refute facts. This is part of my devious plan to make people seem immature when they disagree with me *heh heh*

Of course, I actually do like singular better because in my opinion, it is less confusing. This is a little hard to quantify. But especially when you extend the discussion to naming views, stored procedures, indexes and primary keys which depend on the table, and whose names should be influenced by the table name, my personal experience is singular table names make everything clearer.

Technorati Tags:No Tags

You might also like:

  1. My personal SQL coding standards

4 Responses to “Singular vs. plural table names”


  1. 1 Eric Swanson

    I recently blogged about whether to use singular vs. plural table names.

  2. 2 Douglas

    I have a bag, it contains apples,
    so I wrote apples on the outside.
    I am not sure what to do when I have eaten all but one.
    Should I have written ‘apple bag’ instead?

  3. 3 Xaprb

    An Apple Bags is

    a great autumn dilemma

    springtime will come soon

  4. 4 kismet

    We are absolutely sure about tables are containing more than one record right? (okay sometimes we put only one record but it’s rare) so i believe you don’t have to make it clear. But i’m missing the plural also.

Leave a Reply

Please do not use this blog to get help with problems or bugs in Maatkit or innotop: use the Sourceforge forums, mailing list, or bug trackers. If you're asking for help with MySQL, please use the MySQL mailing list instead.