Another database question...

BigToque

Lifer
Oct 10, 1999
11,700
0
76
I'm making a database to hold the stats for my hockey team. I want to be able to display things like goals, assists, and points.

I can make a field to hold the goals and assists, but dont know how to make a field that holds the points (which is a sum of goals and assists).

Is it possible to even have a field that holds a sum value, or do I just use select commands to sum the goals and assists fields and then display the results on the webpage each time the page is loaded?
 

mugs

Lifer
Apr 29, 2003
48,920
46
91
Originally posted by: Stefan
Is it possible to even have a field that holds a sum value, or do I just use select commands to sum the goals and assists fields and then display the results on the webpage each time the page is loaded?

^bingo

You could compute it yourself and update the points field anytime you do an update query on the goals or assists, but as I mentioned in your OT thread about this, it's best to store the "raw" data rather than computed data, especially if you already have the raw data in the database (that violates some normal form, forget which).