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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:34:20+00:00 2026-06-02T20:34:20+00:00

I have a dating site where each user has own profile with more than

  • 0

I have a dating site where each user has own profile with more than 20 attributes like age, gender, hobbies etc. For this I have table user_profile where all attributes are in 1 row.

For searching and match calculator, it would be probably better to have attributes values in int, better than having it in varchar. But now I am not sure how to print all attributes names if name is not also a value.

So I was thinking to create two tables:

user_profile
user_id | gendre | like_pets | drinks | body_type | eyes | hair_color | ...
1       | 1      | 3         | 2      | 4         |  5   | 5          | ...
2       | 2      | 4         | 2      | 3         |  3   | 5          | ...
user_attributes
id | attr_group | value_name | attr_value
1  | 1          | male      | 1
2  | 1          | famale    | 2
3  | 2          | Like pets | 1
4  | 2          | Have pets | 2
5  | 2          | Don't like pets | 3
6  | 3          | Blue      | 1
7  | 3          | Gray      | 2
8  | 3          | Green     | 3
9  | 3          | Brown     | 4
... 

But that means I need to create 20 queries to print all value names for all attributes. For example to print eyes color I would need

SELECT * FROM user_attributes WHERE attr_group=3

then again the same for gender, and for each other attribute.

Is this a correct way?

  • 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-02T20:34:22+00:00Added an answer on June 2, 2026 at 8:34 pm

    Yes, it is good to have a lookup table that has all the acceptable values. (Yes, even if there are 20 of them.) You can create a foreign key relation from the other table to the lookup table that’ll tell you at time of row insert / update if the code is trying to link to a value that doesn’t exist. When you’re ready to display the data, just join the tables, and harvest the name.

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

Sidebar

Related Questions

I have online dating service. Premium user see a profile on site. profile is
I have a user table that has many columns, it looks roughly like this:
Let's take for example a dating site with 100.000 users. Each users has about
I just saw this dating site on builtwithbootstrap and have a question about table
I am building a dating site in Django / Python. I have birthday dates
Iam coding a dating application for facebook. The application has to have a standalone
I'm writing a Facebook application, somewhat like a dating site (but not quite), and
I'm developing a typical dating site like male/female seeks male/female between ages x and
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
i'm running a dating site and there is a place where people enter their

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.