I have a table of Teams. Each Team has an ID.
I have another table that holds Players. Each Player is assigned to a team.
So my tables might look something like
CREATE TABLE players (
id INTEGER PRIMARY KEY
name STRING
team_id INTEGER REFERENCES teams(id)
)
CREATE TABLE teams (
id INTEGER PRIMARY KEY
name STRING
)
Does writing _id make it any more clearer that the column is meant to hold an ID of a team (as opposed to maybe a team name)?
If I saw that team was linked to a key on the teams table I would assume the column is meant to hold an ID.
I find that if I started following a convetion where I tack on _id I'll end up with a lot of columns with _id in them, but am not sure whether it adds any value.
IDdoes not mean integer. It means IDentification. – ypercubeᵀᴹ Oct 22 '13 at 18:02