If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Cricket Database ERD

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-22-07, 04:19
jizznit jizznit is offline
Registered User
 
Join Date: Feb 2007
Posts: 2
Cricket Database ERD

Hey Guys,

Im designing a databse for my cricket club to record the results of matchs which will eventually be used in a website so that users can query the databse and view statistics.

My question - is there a best practice concerning what should be put in a table and what should be generated dynamically?

For example Every player will have their own statistics (avg run rate, high score etc) and every cricket season will also have its own statistics ( season avg run rate, season high score etc) and every match will also have its own statistics (game avg runs, game high score, etc).

So far I have included these statistics as attributes (columns) in my tables and thought that I would have a series of triggers that would fire and update the stats when new data is entered once a week after the game and then on the website when a user wishs to view a statistic instead of calculating them I could just do a simple select from a table.

Of course the alternative is that te statistics are calculated when the user requests them - this seems like it would be processor heavy to me.

Is there a best practice.

Thanks in advance.

Jizznit
Reply With Quote
  #2 (permalink)  
Old 02-22-07, 08:54
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
This is one of the parts of a designer's juggling act... You need to figure out what makes sense in a given situation.

As a general rule, I don't store anything that can be calculated in a transactional database. If I enter data into the beastie, then I don't store computed data into it.

A datawarehouse is a very different story. Users don't enter anything into a DW, aggregate data arrives there via some flavor of scheduled job. I keep all kinds of computed data in a DW.

-PatP
Reply With Quote
  #3 (permalink)  
Old 02-22-07, 11:51
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
It's along the same lines as the rules for normalization - Normalize the database to the greatest extent possible, only denormalize when necessary to improve performance.
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Reply With Quote
  #4 (permalink)  
Old 02-22-07, 14:34
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
Can't you just copy the design of a baseball database?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On