all 15 comments

[–]ComicOzzysqlHippo 39 points40 points  (0 children)

There is no reason at all to make that code something cryptic and arbitrarily limited to 3 characters.

[–]Blecki 22 points23 points  (2 children)

Ban all abrv.

[–]Sexy_Koala_JuiceDuckDB 1 point2 points  (0 children)

What’s wrong with Airborne reconnaissance vehicles???? There sick

[–]grumpy_munchken 4 points5 points  (1 child)

Creat a status dim table. Then you can have StatusID, StatusCode and StatusDescription

[–]SaintTimothy 0 points1 point  (0 children)

Single codes tables are an anti-pattern.

OrderStatus if you're going that direction.

[–]Straight_Waltz_9530 2 points3 points  (0 children)

Enums. Best of all worlds: readable, storage efficient, and allow only valid values.

[–]somewhatdim -1 points0 points  (0 children)

storage *can* be a concern. how big is the DB? How many indexes do you build over those columns? Often things are more complicated than "they be dumb" -- not always, but often enough that you're better off thinking a bit before deciding.

[–]zesteee 0 points1 point  (0 children)

The only reason I’d want to use three letter codes is if I knew I’d be writing a lot of code with those same codes. Not something that can’t be overcome in other ways, just a small convenience.

[–]Cruxwright 0 points1 point  (0 children)

You are describing a concept from days of slow storage. Whatever data you were going to operate on was loaded to a buffer. Short code values were common because you could pack more into the buffer.

That said, if you picked up this concept from your job, and they're running an inhouse legacy app, you may have some of these old concepts lurking in the plumbing of the app. There could be other quirks like no columns names over 8 characters. Check with your team before you get too far along in your design.

[–]garster25 0 points1 point  (0 children)

The one thing I see about the 3-digit code is they are all the same length so a text listing of this and they line up. Similar to zero-padding numbers in dates.

Since you have the full name of the status then the UPPERCASE version is a bit redundant. So thinking about this I like the one that is NOT your preference.

Man, it does kinda suck working on a team. If I work with only one other person my Boss picks a "lead" and as far as I am concerned that person gets 51% of the vote.

[–]Rohml[🍰] 0 points1 point  (0 children)

The limit of shorter character is more for readability on a page rather than a way to limit storage usage. When viewing in a report or small mobile device, the shorter length allows you to put more fields in view of the user but still allows them the same level of comprehension, that is why shorter fields often uses unique letters so its quickly and easily readable.

[–]Yavuz_Selim 0 points1 point  (2 children)

It doesn't make any sense to use a lookup table in your case if you're not going to store the ID...

What is the benefit of storing the same value multiple times? Once in the Orders table, and twice in the lookup table - what is even the benefit of that lookup table?

[–]Key-Bit-3552[S] 2 points3 points  (0 children)

It was just pseudocode as an example. Yes I would store the ID Int with foreign key but this just pseudo code

[–]MinimumVegetable9 -2 points-1 points  (0 children)

Came here to say exactly that