Forum Moderators: open

Message Too Old, No Replies

Consistancy within a table - How would YOU do it?

         

neophyte

10:51 am on Feb 19, 2007 (gmt 0)

10+ Year Member



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.

Neophyte

LifeinAsia

4:28 pm on Feb 19, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



If all the sections have the same layout, why not just have 1 main table for the data and add another field called "Section" to differentiate which section.

I would definitely make a new table for Q&A.