Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Criteria for creating a new category table

Criteria for creating a new category table

Scheduled Pinned Locked Moved Database
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JHizzle
    wrote on last edited by
    #1

    Here's my quandry: I am creating a new table that's holding records of message sent within the system. One of the fields is what type of message is being sent which currently falls into only 3 options. Currently, it's likely that this is not going to change that much but I'm trying to work out if it's better to create a new table to hold these and thus enforce referential integrity or simply not bother and rely on the enumeration on the code end. Queries against the data is likely to want grouping by message type but with only 3, it just seems a bit overkill. Any suggestions?

    D 1 Reply Last reply
    0
    • J JHizzle

      Here's my quandry: I am creating a new table that's holding records of message sent within the system. One of the fields is what type of message is being sent which currently falls into only 3 options. Currently, it's likely that this is not going to change that much but I'm trying to work out if it's better to create a new table to hold these and thus enforce referential integrity or simply not bother and rely on the enumeration on the code end. Queries against the data is likely to want grouping by message type but with only 3, it just seems a bit overkill. Any suggestions?

      D Offline
      D Offline
      David Mujica
      wrote on last edited by
      #2

      From a purist standpoint, it would be better to create a parent table like: MessageType ID int, Description Varchar and create a constraint against your Message Table to ensure that only valid message types are created in your table. You won't pay much (if any) performance penalty because your parent table is so small. That's my vote. :cool:

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups