Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Is there a naming convention for lookup tables? I cannot see any declaration by oracle or anything consistent on google.

However I assume some of you professional DBAs follow a convention? Perhaps there is a convention which occurs the most when you are called to edit a project you didn't author?

example table

metals

+----+------------+
| id | metal_type |
+----+------------+
| 1  |    gold    |
| 2  |    silver  |
| 3  |    bronze  |
| 4  |    brass   |
+----+------------+

Currently I have been using the original table name + the column name as my lookup table name.

metals_metal_type

I decided to change to LK_ + original table + column as it allows easier navigation when browsing all tables.

LK_metals_metal_type

What are your views on this?

Thanks

share|improve this question

closed as primarily opinion-based by RolandoMySQLDBA, Paul White, Mark Storey-Smith, ypercube, Michael - sqlbot Mar 1 at 17:47

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Have a look at ss64.com/ora/syntax-naming.html –  Abdul Manaf Feb 26 at 5:07
1  
Personally, I try to make my table names as descriptive and as English as possible. No prefixes. Why not just "metals"? –  Colin 't Hart Feb 27 at 13:47

1 Answer 1

up vote 2 down vote accepted

Technically no there isn't a standard for table naming conventions. As long as you use something consistent across your environment there shouldn't be a problem. It should also be well documented as to why you are using this prefix.

That being said however here are few rules that I follow. IAlwaysBookEndMyTables the reason for doing this is it make it clear to read without any spaces or underscores. The reason I don't use underscores is that I'm a SQL server guy and they can be used as a wild card. When naming a lookup table I've typically used LU. Once again this doesn't matter as long as you are doing things consistently. LKMetalsMetalType isn't really any different from LUMetalsMetalType.

One other thing be as descriptive with your table names as possible. Whoever picks up after you leave a project should be able to look at your table structure and have a good idea what's going on. There's plenty of room for a long table name but very limited sanity in trying to figure out what the heck the Pl_uva table means. FYI that was just an example.

I shouldn't have to say this and am assuming you already know but I'll say it anyway. Do not use reserved words or include spaces in your table names. I swear to god I saw a guy on Stack Overflow yesterday who had named a column "from" so it was literally.

SELECT
    [FROM]
FROM HisTable
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.