dbTalk Databases Forums  

English help: name a boolean value that means "if it makes senseto calculate the sum of the field"

comp.databases.postgresql comp.databases.postgresql


Discuss English help: name a boolean value that means "if it makes senseto calculate the sum of the field" in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #41  
Old   
Ben Finney
 
Posts: n/a

Default Re: English help: name a boolean value that means "if it makes sense to calculate the sum of the field" - 05-21-2008 , 05:59 AM






Ben Finney <bignose+hates-spam (AT) benfinney (DOT) id.au> writes:

Quote:
Probably better would be to define a new type, 'quantity', and make
the "number of people" an attribute of this 'quantity' type.
That's unclearly worded. What I mean is: make the attribute "number of
people" be of type 'quantity'.

Quote:
You could then define your functions that perform summing operations
to only accept this 'quantity' type for the values to sum.
--
\ “Our task must be to free ourselves from our prison by |
`\ widening our circle of compassion to embrace all humanity and |
_o__) the whole of nature in its beauty.” —Albert Einstein |
Ben Finney


Reply With Quote
  #42  
Old   
EricF
 
Posts: n/a

Default Re: English help: name a boolean value that means "if it makes senseto calculate the sum of the field" - 05-21-2008 , 10:47 PM






In article <69ibfdF33anfqU1 (AT) mid (DOT) individual.net>, Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> wrote:
Quote:
Ben Finney wrote:
Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> writes:

I have a db table for all fields used in a calculation.

id field_name
-------------
01 Telephone Number
02 Number of Children
.. ...

Now I wish to add a column of a boolean value to represent if it
makes sense to sum up this field. let's say, it makes sense to sum
up number of children so you know how many children in total are
there, but it doesn't make sense to sum up telephone number.

The example of a telephone number is easily solved for this case:
don't make telephone numbers as numeric types. There are no numeric
operations that make sense on telephone numbers, so store them as a
text type or some more-specific type, not numeric.

Hi. Maybe I didn't use the best example. So I give an alternative example:

id field_name
-------------
01 Age
02 Number of Children

In reality few would like to calculate the sum of ages of a group of
people, but they do have the interest to calculate how many children
they have.

A more vivid example even closer to our context:

03 The level of your satisfaction to the government's reaction to the
earth quick in SiChuan, please describe using scale from 1 to 5.
04 The death number in your family in this earth quake

Some people might be interested to see the average satisfaction level
from 1-5 on a county-scale, but they don't have interest to see the sum
(because the sum of satisfaction level doesn't reflect any meaningful
figure).

But, everybody wish to know the sum of death on a county scale, if every
family answered the question.

Thanks!
I'm not sure I like the examples but whatever. Name your boolean
can_sum/can_add or something like that.

Eric


Reply With Quote
  #43  
Old   
EricF
 
Posts: n/a

Default Re: English help: name a boolean value that means "if it makes senseto calculate the sum of the field" - 05-21-2008 , 10:47 PM



In article <69ibfdF33anfqU1 (AT) mid (DOT) individual.net>, Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> wrote:
Quote:
Ben Finney wrote:
Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> writes:

I have a db table for all fields used in a calculation.

id field_name
-------------
01 Telephone Number
02 Number of Children
.. ...

Now I wish to add a column of a boolean value to represent if it
makes sense to sum up this field. let's say, it makes sense to sum
up number of children so you know how many children in total are
there, but it doesn't make sense to sum up telephone number.

The example of a telephone number is easily solved for this case:
don't make telephone numbers as numeric types. There are no numeric
operations that make sense on telephone numbers, so store them as a
text type or some more-specific type, not numeric.

Hi. Maybe I didn't use the best example. So I give an alternative example:

id field_name
-------------
01 Age
02 Number of Children

In reality few would like to calculate the sum of ages of a group of
people, but they do have the interest to calculate how many children
they have.

A more vivid example even closer to our context:

03 The level of your satisfaction to the government's reaction to the
earth quick in SiChuan, please describe using scale from 1 to 5.
04 The death number in your family in this earth quake

Some people might be interested to see the average satisfaction level
from 1-5 on a county-scale, but they don't have interest to see the sum
(because the sum of satisfaction level doesn't reflect any meaningful
figure).

But, everybody wish to know the sum of death on a county scale, if every
family answered the question.

Thanks!
I'm not sure I like the examples but whatever. Name your boolean
can_sum/can_add or something like that.

Eric


Reply With Quote
  #44  
Old   
EricF
 
Posts: n/a

Default Re: English help: name a boolean value that means "if it makes senseto calculate the sum of the field" - 05-21-2008 , 10:47 PM



In article <69ibfdF33anfqU1 (AT) mid (DOT) individual.net>, Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> wrote:
Quote:
Ben Finney wrote:
Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> writes:

I have a db table for all fields used in a calculation.

id field_name
-------------
01 Telephone Number
02 Number of Children
.. ...

Now I wish to add a column of a boolean value to represent if it
makes sense to sum up this field. let's say, it makes sense to sum
up number of children so you know how many children in total are
there, but it doesn't make sense to sum up telephone number.

The example of a telephone number is easily solved for this case:
don't make telephone numbers as numeric types. There are no numeric
operations that make sense on telephone numbers, so store them as a
text type or some more-specific type, not numeric.

Hi. Maybe I didn't use the best example. So I give an alternative example:

id field_name
-------------
01 Age
02 Number of Children

In reality few would like to calculate the sum of ages of a group of
people, but they do have the interest to calculate how many children
they have.

A more vivid example even closer to our context:

03 The level of your satisfaction to the government's reaction to the
earth quick in SiChuan, please describe using scale from 1 to 5.
04 The death number in your family in this earth quake

Some people might be interested to see the average satisfaction level
from 1-5 on a county-scale, but they don't have interest to see the sum
(because the sum of satisfaction level doesn't reflect any meaningful
figure).

But, everybody wish to know the sum of death on a county scale, if every
family answered the question.

Thanks!
I'm not sure I like the examples but whatever. Name your boolean
can_sum/can_add or something like that.

Eric


Reply With Quote
  #45  
Old   
EricF
 
Posts: n/a

Default Re: English help: name a boolean value that means "if it makes senseto calculate the sum of the field" - 05-21-2008 , 10:47 PM



In article <69ibfdF33anfqU1 (AT) mid (DOT) individual.net>, Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> wrote:
Quote:
Ben Finney wrote:
Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> writes:

I have a db table for all fields used in a calculation.

id field_name
-------------
01 Telephone Number
02 Number of Children
.. ...

Now I wish to add a column of a boolean value to represent if it
makes sense to sum up this field. let's say, it makes sense to sum
up number of children so you know how many children in total are
there, but it doesn't make sense to sum up telephone number.

The example of a telephone number is easily solved for this case:
don't make telephone numbers as numeric types. There are no numeric
operations that make sense on telephone numbers, so store them as a
text type or some more-specific type, not numeric.

Hi. Maybe I didn't use the best example. So I give an alternative example:

id field_name
-------------
01 Age
02 Number of Children

In reality few would like to calculate the sum of ages of a group of
people, but they do have the interest to calculate how many children
they have.

A more vivid example even closer to our context:

03 The level of your satisfaction to the government's reaction to the
earth quick in SiChuan, please describe using scale from 1 to 5.
04 The death number in your family in this earth quake

Some people might be interested to see the average satisfaction level
from 1-5 on a county-scale, but they don't have interest to see the sum
(because the sum of satisfaction level doesn't reflect any meaningful
figure).

But, everybody wish to know the sum of death on a county scale, if every
family answered the question.

Thanks!
I'm not sure I like the examples but whatever. Name your boolean
can_sum/can_add or something like that.

Eric


Reply With Quote
  #46  
Old   
EricF
 
Posts: n/a

Default Re: English help: name a boolean value that means "if it makes senseto calculate the sum of the field" - 05-21-2008 , 10:47 PM



In article <69ibfdF33anfqU1 (AT) mid (DOT) individual.net>, Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> wrote:
Quote:
Ben Finney wrote:
Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> writes:

I have a db table for all fields used in a calculation.

id field_name
-------------
01 Telephone Number
02 Number of Children
.. ...

Now I wish to add a column of a boolean value to represent if it
makes sense to sum up this field. let's say, it makes sense to sum
up number of children so you know how many children in total are
there, but it doesn't make sense to sum up telephone number.

The example of a telephone number is easily solved for this case:
don't make telephone numbers as numeric types. There are no numeric
operations that make sense on telephone numbers, so store them as a
text type or some more-specific type, not numeric.

Hi. Maybe I didn't use the best example. So I give an alternative example:

id field_name
-------------
01 Age
02 Number of Children

In reality few would like to calculate the sum of ages of a group of
people, but they do have the interest to calculate how many children
they have.

A more vivid example even closer to our context:

03 The level of your satisfaction to the government's reaction to the
earth quick in SiChuan, please describe using scale from 1 to 5.
04 The death number in your family in this earth quake

Some people might be interested to see the average satisfaction level
from 1-5 on a county-scale, but they don't have interest to see the sum
(because the sum of satisfaction level doesn't reflect any meaningful
figure).

But, everybody wish to know the sum of death on a county scale, if every
family answered the question.

Thanks!
I'm not sure I like the examples but whatever. Name your boolean
can_sum/can_add or something like that.

Eric


Reply With Quote
  #47  
Old   
EricF
 
Posts: n/a

Default Re: English help: name a boolean value that means "if it makes senseto calculate the sum of the field" - 05-21-2008 , 10:47 PM



In article <69ibfdF33anfqU1 (AT) mid (DOT) individual.net>, Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> wrote:
Quote:
Ben Finney wrote:
Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> writes:

I have a db table for all fields used in a calculation.

id field_name
-------------
01 Telephone Number
02 Number of Children
.. ...

Now I wish to add a column of a boolean value to represent if it
makes sense to sum up this field. let's say, it makes sense to sum
up number of children so you know how many children in total are
there, but it doesn't make sense to sum up telephone number.

The example of a telephone number is easily solved for this case:
don't make telephone numbers as numeric types. There are no numeric
operations that make sense on telephone numbers, so store them as a
text type or some more-specific type, not numeric.

Hi. Maybe I didn't use the best example. So I give an alternative example:

id field_name
-------------
01 Age
02 Number of Children

In reality few would like to calculate the sum of ages of a group of
people, but they do have the interest to calculate how many children
they have.

A more vivid example even closer to our context:

03 The level of your satisfaction to the government's reaction to the
earth quick in SiChuan, please describe using scale from 1 to 5.
04 The death number in your family in this earth quake

Some people might be interested to see the average satisfaction level
from 1-5 on a county-scale, but they don't have interest to see the sum
(because the sum of satisfaction level doesn't reflect any meaningful
figure).

But, everybody wish to know the sum of death on a county scale, if every
family answered the question.

Thanks!
I'm not sure I like the examples but whatever. Name your boolean
can_sum/can_add or something like that.

Eric


Reply With Quote
  #48  
Old   
EricF
 
Posts: n/a

Default Re: English help: name a boolean value that means "if it makes senseto calculate the sum of the field" - 05-21-2008 , 10:47 PM



In article <69ibfdF33anfqU1 (AT) mid (DOT) individual.net>, Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> wrote:
Quote:
Ben Finney wrote:
Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> writes:

I have a db table for all fields used in a calculation.

id field_name
-------------
01 Telephone Number
02 Number of Children
.. ...

Now I wish to add a column of a boolean value to represent if it
makes sense to sum up this field. let's say, it makes sense to sum
up number of children so you know how many children in total are
there, but it doesn't make sense to sum up telephone number.

The example of a telephone number is easily solved for this case:
don't make telephone numbers as numeric types. There are no numeric
operations that make sense on telephone numbers, so store them as a
text type or some more-specific type, not numeric.

Hi. Maybe I didn't use the best example. So I give an alternative example:

id field_name
-------------
01 Age
02 Number of Children

In reality few would like to calculate the sum of ages of a group of
people, but they do have the interest to calculate how many children
they have.

A more vivid example even closer to our context:

03 The level of your satisfaction to the government's reaction to the
earth quick in SiChuan, please describe using scale from 1 to 5.
04 The death number in your family in this earth quake

Some people might be interested to see the average satisfaction level
from 1-5 on a county-scale, but they don't have interest to see the sum
(because the sum of satisfaction level doesn't reflect any meaningful
figure).

But, everybody wish to know the sum of death on a county scale, if every
family answered the question.

Thanks!
I'm not sure I like the examples but whatever. Name your boolean
can_sum/can_add or something like that.

Eric


Reply With Quote
  #49  
Old   
EricF
 
Posts: n/a

Default Re: English help: name a boolean value that means "if it makes senseto calculate the sum of the field" - 05-21-2008 , 10:47 PM



In article <69ibfdF33anfqU1 (AT) mid (DOT) individual.net>, Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> wrote:
Quote:
Ben Finney wrote:
Zhang Weiwu <zhangweiwu (AT) realss (DOT) com> writes:

I have a db table for all fields used in a calculation.

id field_name
-------------
01 Telephone Number
02 Number of Children
.. ...

Now I wish to add a column of a boolean value to represent if it
makes sense to sum up this field. let's say, it makes sense to sum
up number of children so you know how many children in total are
there, but it doesn't make sense to sum up telephone number.

The example of a telephone number is easily solved for this case:
don't make telephone numbers as numeric types. There are no numeric
operations that make sense on telephone numbers, so store them as a
text type or some more-specific type, not numeric.

Hi. Maybe I didn't use the best example. So I give an alternative example:

id field_name
-------------
01 Age
02 Number of Children

In reality few would like to calculate the sum of ages of a group of
people, but they do have the interest to calculate how many children
they have.

A more vivid example even closer to our context:

03 The level of your satisfaction to the government's reaction to the
earth quick in SiChuan, please describe using scale from 1 to 5.
04 The death number in your family in this earth quake

Some people might be interested to see the average satisfaction level
from 1-5 on a county-scale, but they don't have interest to see the sum
(because the sum of satisfaction level doesn't reflect any meaningful
figure).

But, everybody wish to know the sum of death on a county scale, if every
family answered the question.

Thanks!
I'm not sure I like the examples but whatever. Name your boolean
can_sum/can_add or something like that.

Eric


Reply With Quote
  #50  
Old   
Zhang Weiwu
 
Posts: n/a

Default [SOLVED] Re: English help: name a boolean value that means "if itmakes sense to calculate the sum of the field" - 05-23-2008 , 10:59 PM



Zhang Weiwu wrote:
Quote:
Now I wish to add a column of a boolean value to represent if it makes
sense to sum up this field. let's say, it makes sense to sum up number
thank you very much for all of the suggestions. I finally settle down
with IsQuantity.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.