News for hackers. Stuff that matters.
Re:For Want of a JOIN by int_19h on Thursday December 22, 2022 @06:12PM (#34100216)
It's the other way around - "software people" tend to use plurals for table names, because it then maps nicely to plurals in property names in their object layer, where it's already the established convention.

The "database people" OTOH tend to use singular, which goes at least as far back as C.J. Date. I'm not sure why, but perhaps it's because fully qualified field names read more natural.

Re:For Want of a JOIN by somat on Thursday December 22, 2022 @11:01PM (#34102215)
it is either a bunch of apples in which case you would call it apples, or it is the box that holds apples, in which case you would call it apple. as in apple_box.

Got to admit I am pretty firmly in "it is the box that holds apples" camp so none of my array, table, dictionary names are plural. Some time I comfort myself by saying "well, apple[5] just sounds better" but that is really up for debate.

Re:For Want of a JOIN by fijiaarone on Sunday December 25, 2022 @05:31PM (#34132175)
Actually, all the old relational texts talk about select * from employees (plural) because they didn’t have aliases for table names in queries.

I agree that when you use aliases for multiple tables when you use (Oracle, non-standard SQL joins) that it looks prettier, but you can also do that with plural table names.

Select employee.name manager.name from employee, manager where employee.manager_id = manager.id

But it doesn’t matter that much when you use the traditional join syntax:

Select employees.name, managers.name from employees left outer join managers as manager on employees.manager_id = managers.id

Still I prefer singular table names, just disagree that it was data people who preferred singular and why.

Of course, with aliases you can return the exact name you want with aliases:

Select e.name as employee, m.name as manager from employees e, managers m where e.manager_id = m.id