Re: Table schema question

From: Barry <BarryJJ_at_ATTGlobal.Net>
Date: Tue, 23 Jan 2001 21:02:49 -0500
Message-ID: <3a6e39ec_2_at_news1.prserv.net>


Michael Chiu wrote:

> I'm setting up a simple content management site, and I have a question
> about my database layout. I am trying to manage different areas of the
> site that are somewhat similar.
>
> I have decided to use a tbl_dates to store information about the date
> the record should go live and when it should expire. One of the tables
> is tbl_press to store press release information, another is tbl_main to
> store content for the main page of the site, and tbl_mike to store
> information for my editorials page.
>
> If some of the tables share common fields, is it better to store all
> those common fields in a separate table, or is better to keep them with
> the table in which they are pertinent. Right now, only the tbl_main
> needs to store image name information, but other tables may eventually
> store that data also. There are likely to be other fields that may be
> common to 2 of the 3 or perhaps to some of the eventual larger number
> of tables. It makes sense to centralize it in one table for the
> purpose of easy updating of the field name or whatever in the future
> ... not having to make the change in several tables. However, it makes
> it necessary to joins all the time, and it seems quicker to just avoid
> that.

It would be easier with some examples. Which way to go is completely dependent on the definition of attributes you believe are common.

For example, you mention "image name" which for now, in your model, only applies to the "main page". If you define it as "Main Page Image", then it belongs where you have it and you will separately have "?Mike's Page Image" and "Press Page Image" in their respective places.

On the other hand, if you define it as an image that may be used on any of the different types of pages, then that definition says it gets stripped out into its own table, with links to each of the contexts in which it might be used.

Each design has its advantages and disadvantages, and in turn affects how the application on top of the data is built.

It's weighing questions like this that make data modelling interesting!

Probably not much help ... Barry J. Received on Wed Jan 24 2001 - 03:02:49 CET

Original text of this message