• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Another database question...

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?
 
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).
 
Back
Top