I was wondering peoples opinions on the naming of ID columns in database tables.
If I have a table called Invoices with a primary key of an identity column I would c
FWIW, our new standard (which changes, uh, I mean "evolves", with every new project) is:
pk_ prefix means primary key_id suffix means an integer, auto-increment IDfk_ prefix means foreign key (no suffix necessary)_VW suffix for viewsis_ prefix for booleansSo, a table named NAMES might have the fields pk_name_id, first_name, last_name, is_alive, and fk_company and a view called LIVING_CUSTOMERS_VW, defined like:
SELECT first_name, last_name FROM CONTACT.NAMES WHERE (is_alive = 'True')
As others have said, though, just about any scheme will work as long as it is consistent and doesn't unnecessarily obfuscate your meanings.