database-designconstants

Where Constants should be stored in the database


I've been wondering whether constants like "Approved, disapproved, pending" or "Single, married, divorced" should be grouped up in a single table holding references to what module they are used at in the database or into separate tables for each relevant module. Which one is more practical?


Solution

  • Separate tables in order for the database to enforce foreign key constraints that only applies for the referencing table.