Hi Markus,

Yesterday I received your great book!

But there is one thing I like to ask: Why do you use table names in plural (e.g Employees)?

I'm using ERM and SQL since 1995 and always used singular.

Thanks, Simon

asked Jul 31 '14 at 09:54

simas's gravatar image


One Answer:

I'm using plural because it is a better fit for the mental model behind tables (or relations or sets). In a table you store many employees, not a single one.

In object oriented programming, on the other hand, it makes sense to use singular names for classes because the each instance only stores one employee (for example). In that context plural only makes sense when having a collection of employee objects.

Quite often, using the wrong numerus (plural/singular) indicates a wrong understanding of the underlying principles. In SQL you always work we sets that happen to have only one member sometimes—still it is a set :)

answered Jul 31 '14 at 11:50

Markus%20Winand's gravatar image

Markus Winand ♦♦

I see the point.

So in ORM you would map the singular classes to plural tables and when doing ERM the logical model will be singular and the physical plural, right?

There will be a lot of mapping between the two models.

(Jul 31 '14 at 16:32) simas

@simas In theory: yes. In practice it might be more convenient to settle for one and utilize automatic mappings. I guess on the long run it might still be better to follow my scheme—but I don't have any hard figures for that.

(Jul 31 '14 at 16:36) Markus Winand ♦♦

I will stay with the singular - so the tables will represent my models (OO or ERM) and all of my customer use the singular form.

But you are right when it comes to the tables it feels more natural.

Thanks for your time.

(Jul 31 '14 at 16:43) simas