Naming Database Tables: Is It Person, Peoples, Persons or People?
the.agilesql.club
the.agilesql.club
I like the singular guidance for all the reasons given. I like the consistency guidance. But the real world sometimes gets in the way.
create table people(person_id int)
This literally drives me to distraction and I want to throw my computer out of the window :)
create table person(id int)
According to Rails it's create table people(id int)
Both agree on how to name the primary key. Person_id would be redundant."select id as tablename_id, * from table"
just doesn't feel quite right to me personally
select *
from person
join phone on person.id = phone.person select *
from person p
join phone ph on p.id = ph.person- an API endpoint
- an array
- a computer folder
- a paper folder