Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7084069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:15:22+00:00 2026-05-28T07:15:22+00:00

I am using SQL Server 2005. I have a site that people can vote

  • 0

I am using SQL Server 2005.

I have a site that people can vote on awesome motorcycles. Each time a user votes, there is one for the first bike and one vote against the second bike. Two votes are stored in the database. The vote table looks like this:

VoteID VoteDate     BikeID Vote
1      2012-01-12   123    1
2      2012-01-12   125    0
3      2012-01-12   126    0
4      2012-01-12   129    1

I want to tally the votes for each bike quite frequently, say each hour. My idea is to store the tally as a percentage of contest won versus lost on the bike table as an attribute of the bike. So, if a bike won 10 contests and lost 20 contest, they would have a score (tally) of 33. I would tally up daily, weekly, and monthly scores.

BikeID  BikeName  DailyTally WeeklyTally MonthlyTally
1       Big Dog   5          10          50
2       Big Cat   3          15          40
3       Small Dog 9          8           0
4       Fish Face 19         21          0

Right now, there are about 500 votes per day being cast. We anticipate 2500 – 5000 per day in the next month or so.

What is the best way to tally the data and what is the best way to store it? Should the tallies be on their own table? Should a trigger be used to run a new tally each time a bike is voted on? Should a stored procedure be run hourly to get all tallies?

Any ideas would be very helpful!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:15:22+00:00Added an answer on May 28, 2026 at 7:15 am

    Store your VoteDate as a datetime value instead of just date.

    For your tallies, you can just make that a view and calculate it on the fly. This should be very simple to do using GROUP BY and DATEPART functions. If you need exact code for how to do this, please open a new question.

    For that low volume of rows it doesn’t make any sense to store aggregations in a table when you can just calculate them whenever you want to see them and get accurate and immediate results that are up-to-date.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL Server 2005 database for a web site that stores user
I'm using SQL Server 2005. I have a field that must either contain a
I am using MS SQL Server 2005, I have dates stored in epoch time
We have a Windows VPS server using SQL Server 2005 for our e-commerce site.
Using SQL Server 2005 management studio, I have exported each Sprocs and Functions as
I'm using sql server 2005/2008 and I have a table that it's PK (rec_index)
I'm using SQL Server 2005. I have a query to a server that gives
Using SQL Server 2005: I have one stored proc that calls several others within
Using SQL Server 2005 I have a field that contains a datetime value. What
I'm using SQL Server (2005). Today I have some tables that everytime the data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.