What is enum

I have a few colums with the name subscription1, subscription2 and subscription3 for my piano service. I am just wondering what is enum? Look like a drop down box… should I use enum or just have those columns in my users table?

It depends. There are some special rules to be aware of DB enums and upgrading an ENUM field is costly. Rule-of-thumb: only use an enum if its values never change (e.g. IP version number).

the spawn of the devil… avoid, avoid, avoid


1 Like

It would be better to create a subscriptions table with all the subscription and their details (price, description, number of lessons, difficulty, etc) and than have an ID in that table, and then put the corresponding ID for every user that has that subscription. This allows you correlate the two tables together so you could query for example for the sum of earnings for all students with subscription x.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.