title: MySQL design: A query to get collection with most actions within a given timeframe
body: <p>I have a table called <code>topic</code> that has a column named <code>like_count</code>.</p>
  
  <p>Is it possible to write a query on that table to ask "give me the top 10 most liked topics in the past 7 days", meaning the 10 topics that have had the most likes on them in the past 7 days, without creating an additional auditing table?</p>
  
  <p>I was thinking of doing this by creating some auditing table such as <code>topic_like_audit</code> that would have just two columns: <code>topic_id</code> and <code>created_at</code>. Every time the topic with that ID got liked, a new record would be stored in the audit table. Then I can write a query that aggregates all results within the past 7 days using the <code>created_at</code> column, and ranks by the ones that have the most amount of records in that timeframe.</p>
  
  <p>But I can't imagine that being a scalable solution... it may work in the short term, but that surely must be bad when you have topics that have millions, or even hundreds of thousands of likes.</p>
  
  <p>Any good, standard solutions on doing something like this, or is my approach sufficient? P.S. I'm a DB noob.</p>