When to use enumeration in a lookup table?

When to use enumeration in a lookup table?

Generally you should only use enumeration where there is a clear set of items that will not change, e.g. primary colours, or continent names. Otherwise lookup tables with appropriately implemented foreign keys are pretty much always the best option.

Which is better lookup table or enum in PHP?

Definitely a good idea to steer clear of ENUM IMHO: why ENUM is evil. Technically a lookup table would be the preferred solution although for simple values a PHP class would work. You do need to be careful of this for the same reasons as ENUM; if the values in your set grow it could become difficult to maintain.

Why do I use enums in front end?

I use enums in the front end and the business layer because its easy to develop with them and you dont have to get the list from the dal neither you have to remember the values from the table. C# automatically convert the enums to corresponding ID for you if the list is same in the table and the enum.

How many reference tables are there in MySQL database?

While I’m designing a MySQL database for a dating website, I have come with the doubt of how to store the referenced data. Currently the database has 33 tables and there are nearly 32 different fields who need to be referenced. We have to consider as well that many of these elements need to be translated.

Which is the best option for a lookup table?

Otherwise lookup tables with appropriately implemented foreign keys are pretty much always the best option. There is a possible variation on the lookup table option where you potentially have a large number of lookup tables for simple id/value relationships.

How to convert enums to ID in C #?

C# automatically convert the enums to corresponding ID for you if the list is same in the table and the enum. In MVC you can use the dropdown with the enums as @Html.EnumDropdownListFor () in the View so you dont have to the hit the database itself for dropdowns.