Time reference in a table

gutmj

Registered User.
Local time
Today, 18:51
Joined
May 2, 2008
Messages
26
Hi All

I am struggling with a table design. The table have the following fields:

market_id, cost1, cost2, cost3, submitMonth, submitYear

Markets will submit data on monthly basis and the data will be appended to the table. However a few markets will submit data on quarterly basis and some every six months. Not sure how it could be represented in the table / database.
Should I create additional table for quarterly / 6-monthly submissions and then use "union" when querying?

Thanks for any suggestions.
 
Storing same type of data in different storage bins is a crime against normalization. The immediate penalty consists of painful queries, forms and reports.

Your data is tagged by date, so deal with the tag in the logic of your code or queries.
 
Also, numerated fields (i.e. cost1, cost2, cost3) are strong circumstantial evidence of your crimes as well.

What exactly do you want your queries to produce? Sample input data and sample output data would be helpful.
 

Users who are viewing this thread

Back
Top Bottom