I've seen two methods of naming primary keys:
1) All primary keys are named ID.
This has the following advantages:
- it's easy to find out which column is a PK and which isn't;
- it's less typing;
- join conditions read more like English:
... WHERE File.DirectoryID = Directory.ID
... WHERE BlogEntryTag.TagID = Tag.ID AND BlogEntryTag.BlogEntryID = BlogEntry.ID
2) All primary keys are named <tablename>ID.
This has the advantage that the primary key column and the referring foreign key column will have the same name. Apparently, some people think this makes it easier to write tools and scripts:
... WHERE File.DirectoryID = Directory.DirectoryID
... WHERE BlogEntryTag.TagID = Tag.TagID AND BlogEntryTag.BlogEntryID = BlogEntry.BlogEntryID
Personally, I prefer the first method, but I've seen very few places that implement it and a lot of places that implement the second method (or a more or less ugly abomination of it).
Which one do you prefer and why?