0

Hello,

I'm currently designing a simple movie database. In a table I have a column called status. And for that there will only be a few possibilities like "pending", "watched" etc...

What would be a good way to design it such that I have some kind of constant? Should I use integers, like 1="pending" 2="watched", or should I link it to another table? Or simply use strings?

Thanks.

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by griswolf
0

1. Add a check constraint with numbers only as value.
2. For the values refer to another column in some look up table.
3. In that table store the actual meaning of the numbers
i.e.-- 1="pending" 2="watched" etc..

0

Some databases have enum values (MySql and Postgresql both do) that are pretty much what @debasisdas suggested, but hide some of the complexity.

Edited by griswolf: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.