by Sn0wCoder · 2y ago · 0 comments
I do agree it makes joins more verbose.
Please don't prefix the main table id with the table name.
I know it is a matter of discipline but any tool that encourages consistency helps. A database schema is definitely one of those tools.
One unrelated idea is to include the entity in the id itself. I have never done this but I’d imagine it would help with things like logging / observability. It would not play nice with indices though.
I also use "id" but I would say SQL was designed with the opinion that ids should be prefixed with the table name.