Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's more readable naming conventions for lookup tables?

We always name lookup tables - such as Countries,Cities,Regions ... etc - as below :
EntityName_LK OR LK_EntityName ( Countries_LK OR LK_Countries )
But I ask if any one have more better naming conversions for lookup tables ?

Edit:
We think to make postfix or prefix to solve like a conflict :
if we have User tables and lookup table for UserTypes (ID-Name) and we have a relation many to many between User & UserTypes that make us a table which we can name it like Types_For_User that may make confusion between UserTypes & Types_For_User So we like to make lookup table UserTypes to be like UserTypesLK to be obvious to all

like image 395
Amr Badawy Avatar asked Jan 16 '11 22:01

Amr Badawy


1 Answers

Here are two concerns for whether to use a prefix or suffix.

  1. In a sorted list of tables, do you want the LK tables to be together or do you want all tables pertaining to EntityName to appear together

  2. When programming in environments with auto-complete, are you likely to want to type "LK" to get the list of tables or the beginning of EntityName?

I think there are arguments for either, but I would choose to start with EntityName.

like image 156
Lou Franco Avatar answered Oct 21 '22 14:10

Lou Franco