11

We were discussing if table names should be singular or plural.
As a good developer, I had to check stackoverflow.
#savetheS is a movement now

Comments
  • 2
    Tables are collections of records, so I'm guilty of the S, unless it's a "config" table or something.

    Also, you don't have to worry about reserved words as much this way either.
  • 2
    select * from schedules.
    Schedules.Where(s => s.Between(DateTime.Now, inTwoDays)).FirstOrDefault();

    plural names always made more sense to me.
  • 0
    @Midnigh-shcode
    When you do something like that, it makes sense.
    List representation can be plural.

    Schedules.where(schedule => schedule.id = 1)

    But :

    Select id from schedules where schedules.id = 1

    Mostly, your domain maps directly to a db model. So you could have a class Schedule that maps to table Schedule and a repository/DAO that can be named Schedules.
  • 1
    list/map? (a list of costumers, a table of bookings) plural

    set of defined data (list of config values) singular
  • 2
    Singular, but only because it maps to classes more naturally that way when using an ORM.

    Beyond that, I don't really care, so long as it's consistent.
  • 1
    I prefer singular, for the reasons others have written, but I don't care too much as long as there is consistency.

    Now back to the db I'm working on that has a Products table and a Component table ๐Ÿ™„
Add Comment