0

I just found SET and ENUM existed for SQL and am hence intrigued to use ENUM to replace 1:N where ENUM simply lists a few properties an object could have. Is it better to have a foreign key for this or model with ENUM for instance?

Vehicle type -> ENUM('BIKE','POGO STICK','SUBMARINE','STAR DESTROYER')

One benefit I see of having a property table is probably when you add a new property you only have to INSERT it to the property table whereas for ENUM you would have to run ALTER table? On the other hand it eliminates one join for DB lookups...?

El Dude
  • 5,328
  • 11
  • 54
  • 101
  • 1
    http://dba.stackexchange.com/questions/6962/advantages-and-disadvantages-to-using-enum-vs-integer-types – juergen d Mar 27 '17 at 22:59
  • http://stackoverflow.com/questions/10300376/which-is-reasonable-to-use-for-a-field-that-appears-in-three-tables-an-enum-or/43389718#43389718 – luba Apr 13 '17 at 13:10

0 Answers0