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 7811515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:11:26+00:00 2026-06-02T04:11:26+00:00

I have some tables, they are: user ============================== user_id | username | etc.. ==============================

  • 0

I have some tables, they are:

user
==============================
 user_id | username | etc..
==============================

user_metadata
====================================
 user_id | birthday | gender | etc..
====================================

game
========================
 game_id | name | etc..
========================

I want to store users liking games, and since age attribute is important, I need to differ when did the like was made, it should be different entity if someone liked a game when he/she was in the age of 5 or was in the age of 8. So which of table structure would you recommend?

  1. Store the age of the user when the likes made:

    user_likes
    ==========================================
     user_id | game_id | user_age_when_liking
    ==========================================
    
  2. Store the timestamp

    user_likes
    ==========================================
     user_id | game_id | liked_at (timestamp)
    ==========================================
    

So with the option number 2, if I need to get all users like with a certain age, I will calculate the year difference between the user birthdate and liked_at.

Other suggestion is very welcomed.

  • 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-06-02T04:11:28+00:00Added an answer on June 2, 2026 at 4:11 am

    It mostly depends on the purpose of the use of the column. If you never need to do any time to time calculations (addition, subtraction etc) based on when the like occurred, than the age of the person is completely valid (basically you’re pre-evaluating birthDate-likeDate). However, if you have any intention of saying that someone liked a game 10 days ago, it will be much more work to reverse the pre-evaluated user-age back to a likeDate to allow another calucation. Keeping in mind that you most likely want to keep your database data extensible, using likedAt is preferred in my opinion.

    I would also note that stackoverflow is not a site designed to answer theoretical questions that don’t have a specific code answer, this question should probably be on programmers.stackexchange.com.

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

Sidebar

Related Questions

I have some tables: Employee: id, name, id_suc, id dep, id_sec Suc : id_suc,
I have two tables User and UserRole which are they connected using a link
I have some tables which basically look as follows: TBL_USER user_id - number user_name
I have some tables with data: Category CategoryID CategoryName 1 Home 2 Contact 3
I have some tables that benefit from many-to-many tables. For example the team table.
I have some tables. These tables all have one column in common called 'classified_id':
I have some tables for which I have no reason to ever update from
I have some transliteration tables in code that are formated to make it easier
I am using Sql database and I have indexed some tables. In some tables
Greetings, I have some mysql tables that are currently using an md5 hash as

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.