Re: newbie: using id's or total desciption

From: stu <smcgouga_at_nospam.co.uk>
Date: Fri, 25 Apr 2003 09:17:41 +0100
Message-ID: <b8ar30$he4$1$8302bc10_at_news.demon.co.uk>


> So how would you make statistics than?
> If i want a statistic about the volume of sale of one customer. What do i
> use? I have name1, name2, name3, street, zipcode, city as invoice data.
> But what to use for statistics. If i change the name1 part of the
> customer data, but the customer istself is the same, i only made a
> spelling mistake, the statistic would be 'wrong' if i do it by counting
> on name1.

Thats why you are using an ID for person's primary key. You can guarntee that it will not change. You will get some people who say you should not introduce a surrogate key (a made up ID) but at the end of the day you NEED a key that can remain with that person for life. And most natural keys are not practical (DNA, finger prints, etc).

> If i use the id it can be wrong beacause the whole data can be changed.

If you mean the persons name etc can change, so what? You can still identify that person with your ID. You can name any person by matching the ID with the current name.

> I agree with your opinion that a should store all beccessary data about
> the customer and the articles but how to do statistics.

You have an ID for person. You can collect statistics using that ID.

> I think at this point i have to make an compromise or give the user a
> selection by what data he wants to make his statistics

Users would run a mile if they were asked "Do you wish to collect statistice by Unique ID or Name?" !! Received on Fri Apr 25 2003 - 10:17:41 CEST

Original text of this message