1

ItemCategory Table

ItemCategory - Primary key, Only accepts values S,M,C,D

CategoryName

is there any possible methods to create this table? THANK YOU!

1
  • 1
    enum as a posibility.
    – danblack
    May 15, 2021 at 12:16

1 Answer 1

0

In most recent versions of MySQL, you can use a check constraint:

alter table itemCategory add constraint check (categoryName in ('S', 'M', 'C', 'D'));
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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