design question - several related variables - in one database field or separate fields

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • NotGiven

    design question - several related variables - in one database field or separate fields

    Say you want to display and search "services offered". There are a finite
    number of services offered. You want to be able to search the database for
    each service offered separately.

    Given the above requirements, is it better to group them in one field and do
    a LIKE % query or have each a seprarte database field?

    I think separate fields but want opinions as I am somewhat new to this.

    Thanks!


  • Herbie Cumberland

    #2
    Re: design question - several related variables - in one database field or separate fields

    On Fri, 23 Jul 2004 16:36:59 -0400, "NotGiven" <noname@nonegiv en.net>
    wrote:
    [color=blue]
    >Say you want to display and search "services offered". There are a finite
    >number of services offered. You want to be able to search the database for
    >each service offered separately.
    >
    >Given the above requirements, is it better to group them in one field and do
    >a LIKE % query or have each a seprarte database field?
    >
    >I think separate fields but want opinions as I am somewhat new to this.
    >
    >Thanks![/color]

    if it's a finite number then use seperate fields.

    if the possibilities are YES or NO for each service then use binary
    fields (1 or 0) - eg. INT(1), CHAR(1) or something like that - this
    will speed up searches considerably (as long as you remember to index
    all the fields you will be including in your 'WHERE' statement).

    Comment

    • NotGiven

      #3
      Re: design question - several related variables - in one database field or separate fields

      good advice - thanks


      "Herbie Cumberland" <spamtrap@skipr aider.com> wrote in message
      news:f304g0hrr8 k76h7ru9llt2btp 8kq4lq21f@4ax.c om...[color=blue]
      > On Fri, 23 Jul 2004 16:36:59 -0400, "NotGiven" <noname@nonegiv en.net>
      > wrote:
      >[color=green]
      > >Say you want to display and search "services offered". There are a[/color][/color]
      finite[color=blue][color=green]
      > >number of services offered. You want to be able to search the database[/color][/color]
      for[color=blue][color=green]
      > >each service offered separately.
      > >
      > >Given the above requirements, is it better to group them in one field and[/color][/color]
      do[color=blue][color=green]
      > >a LIKE % query or have each a seprarte database field?
      > >
      > >I think separate fields but want opinions as I am somewhat new to this.
      > >
      > >Thanks![/color]
      >
      > if it's a finite number then use seperate fields.
      >
      > if the possibilities are YES or NO for each service then use binary
      > fields (1 or 0) - eg. INT(1), CHAR(1) or something like that - this
      > will speed up searches considerably (as long as you remember to index
      > all the fields you will be including in your 'WHERE' statement).
      >[/color]


      Comment

      Working...