Re: Table structure dilemma

From: Kevin Brownhill <BROWNHIK_at_Syntegra.Bt.Co.Uk>
Date: Fri, 24 Jan 2003 15:48:20 -0000
Message-ID: <b0rnki$keq$1_at_pheidippides.axion.bt.co.uk>


"chris" <xnuus_at_hotmail.com> wrote in message news:b04c1374.0301240740.711a9f07_at_posting.google.com...
> Hi
>
> Okay Im having a little difficulty in determing in the correct way
> to structure a table in my database for a problem im working on. It
> holds holds the price of plane flights which fluctates throughout the
> year. For instance:
>
> week 1 = $100
> week 2 = $120
> week 3 = $132
> week 4 = $70
> .
> .
> week 52 = $115
>
> Okay so I got a table: with the column headings Week and Price
>
> But What if I want to introduce a second type of plane Plane B with a
> different set of costs eg
>
> Plane B
>
> week 1 = $200
> week 2 = $320
> week 3 = $232
> week 4 = $170
> .
> .
> week 52 = $215
>
>
> what do I do decide to have as the table headings ?
>
> option 1 - have the column headings as Week, Plane_type , Price
>
> or
>
> option 2 - have a column headings Plane type, week1_price, week2_price
> ... week52_price
>
> option 1 seems right but I would be surely minimising the size of the
> table with option 2 because I would not need to repeat the week
> number.

Option 1 is normalised and easier to use programatically.

Option 2 would be a nightmare to manage - you would have to restructure the table if you wanted to hold more than one year's data. It would be much more difficult to write queries for summary data. Received on Fri Jan 24 2003 - 16:48:20 CET

Original text of this message