Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2006

    Red face Unanswered: Keeping fields consistant within a table

    Hello All -

    I'm designing a database for a fairly large site with a number of sections (i.e. About, Industry, Clients, etc.)

    Generally speaking, all pages within each section have the same layout: Image, headline, subhead, text. Since this was the case, I've decided to name each DB table based upon the section (table - industry) so if someone hits the Industry menu item I just grab the proper page from that table (like "industry > immigration")

    My basic field names for the Industry table are like this:

    ID - row id
    Page - page name
    Title - page title text
    Headline - page headline
    Subhead - page subhead
    Image - source path to the image
    Text - page text.

    So far so good, but then I ran into a "gotcha" in the spec. Also within the industry section is a Q & A page which, naturally, will have multiple subhead fields (for the questions) and multiple text fields (for the answers). Naturally, this is the ONLY page within this section that diverts from the other pages in the industry section.

    So, what to do??? What would you do?

    Since Q & A could contain any number of question and answers, should I create a seperate table for this one page. This would be a shame because I'm trying to keep the DB as lean and uncluttered (with tables) as possible. The scenario above does, however, somewhat blow my desire.

    I haven't been doing DB design for very long, and I can't really come to a better solution than splitting out a table for that one page.

    Any comments and suggestions are greatly appreciated.


  2. #2
    Join Date
    Mar 2004
    You should not have a separate table for each page type, you should have a single table and indicate via a column the page type.

    as for your problem with the industry table, you would add an additional table and use a join to draw the appropriate information out of both tables.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts