5
TangChr
7y

Table names in plural. Really?

Slow clapping

Comments
  • 2
    english native ? if not then it can be that, also it's irrelevant, what's important is consistency, if all table names are plural then fine, make all models plural as well, and stick to it
  • 0
    @Qchmqs I'm not sure if you are dissing my language? But I agree with you on consistency.
  • 7
    Um... why is naming tables in singular better? Makes no sense to me. A table contains multiple rows of entities - users, clients, cars, whatever... i always use plural.

    Models are singular, but controllers are not
  • 3
    I'm saying that the guy who wrote the names might be not native and so he doesn't regard this as an issue at all, also consistency is far more important anyway
  • 0
    @Qchmqs Thanks for clarifying
  • 0
    @Skipp the idea is that you give the table the same name as the thing it's modelling. It really doesn't matter at all though; if this is something that introduces any ambiguity to code or discussions then you've got bigger problems!
  • 2
    I use Ruby on Rails and it's convention to name tables in plural. ActiveRecord works like that. For example table name is cars then model name is Car. It's even smart enough to know the plural vs singular forms of words like wah/watches.
  • 0
    @quanqchau yup - most frameworks/orms do nowadays
  • 2
    Select * from product p inner join subproduct sp gives the feel of 1-1 relationships...but products to subproducts feels like the possibility of many-many, so I guess it depends on your table relationships?
Add Comment