Last post Apr 18, 2013 05:27 PM by smirnov
Apr 18, 2013 04:14 PM|aithex2|LINK
i am confused about this question:
if we have a database table e.g. CASE and there is a field in it called Status
and status will have a list of status like new, open, close, solved etc.
my question is should i make another table for status or i can hard code this? what is standard of DBMS
Apr 18, 2013 05:00 PM|smirnov|LINK
It's all up to you. If case could have only one status then you can have status code saved in Case table, but name of the status could be separately stored in a dedicated table
1 ...... N
2 ...... N
3 ...... O
Apr 18, 2013 05:12 PM|aithex2|LINK
I did the same now, but i did not create a forigen key relation between them. i think it doesn't matter?
Apr 18, 2013 05:27 PM|smirnov|LINK
Again, it's up to you but if you want to follow the best practice, then foreign key is a must. It helps enforce referential integrity (can't insert cases with unknown status, can't delete status if case with such status exists), it helps to execute