Re: Should I use one or two tables for summary data?

From: J.O. Aho <user_at_example.net>
Date: Mon, 6 Feb 2017 21:27:14 +0100
Message-ID: <efs4h3FgafkU1_at_mid.individual.net>


On 02/06/17 19:58, Victor Porton wrote:
> J.O. Aho wrote:
>
>> On 02/06/17 16:51, Victor Porton wrote:

>> If you prompt want to keeps aggregated data, then keep it in a separate
>> table, don't forget to keep track of how you group the data if you have
>> more than one way to group it.

>
> WHY do you suggest to split this data into more than one table (rather than
> using NULL as the sign of aggregated data)?

As mixing aggregated data with the actual data is bad, specially when the values in the columns has slightly different meaning.

It's far cleaner what the data is and also you will be able to have a table name which tells you the data is aggregated. Think about the next person who is poking in your database, when the structure is clear, less likely they will make a mistake.

-- 

 //Aho
Received on Mon Feb 06 2017 - 21:27:14 CET

Original text of this message