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

  • Home
  • SEARCH
  • 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 7637429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:56:13+00:00 2026-05-31T07:56:13+00:00

While I’m designing a MySQL database for a dating website, I have come with

  • 0

While I’m designing a MySQL database for a dating website, I have come with the doubt of how to store the referenced data. Currently the database has 33 tables and there are nearly 32 different fields who need to be referenced. We have to consider as well that many of these elements need to be translated.

After been reading several opinions, I have almost dismissed to use enum like:

CREATE TABLE profile (
  'user_id' INT NOT NULL,
 ...
  'relationship_status' ENUM('Single','Married') NOT NULL,
 ... 
);

And normally I would be using a reference table like:

CREATE TABLE profile (
  'user_id' INT NOT NULL,
 ...
  'relationship_status_id' INT NOT NULL, 
 ... 
);

CREATE TABLE relationship_status (
  'id' INT NOT NULL,
  'name' VARCHAR(45) NOT NULL,
  PRIMARY KEY ('id') 
);

But it might be over-killed to create 32 tables so I’m considering to code it in PHP like this:

class RelationshipStatusLookUp{
  const SINGLE = 1;
  const MARRIED = 2;

  public static function getLabel($status){
      if($status == self::SINGLE)
         return 'Single';
      if($status == self::MARRIED)
         return 'Married';
      return false;
  }
}

What do you think? Because I guess it could improve the performance of the queries and also make easier the development of the whole site.

Thanks.

  • 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-31T07:56:14+00:00Added an answer on May 31, 2026 at 7:56 am

    Definitely a good idea to steer clear of ENUM IMHO: why ENUM is evil. Technically a lookup table would be the preferred solution although for simple values a PHP class would work. You do need to be careful of this for the same reasons as ENUM; if the values in your set grow it could become difficult to maintain. (What about “co-habiting”, “divorced”, “civil partnership”, “widowed” etc). It also not trivial to query for lists of values using PHP classes; it’s possible using reflection but not as easy as a simple MySQL SELECT. This is probably one of those cases where I wouldn’t worry about performance until it becomes a problem. Use the best solution for your code/application first, then optimise if you need to.

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

Sidebar

Related Questions

While fetching Boolean data from database with hibernate SQL query gives the following error
While using boost::threads I have come across this interruption problem. When I do a
While I do a program, sometimes I've got this doubt. I have been using
While listening through Stanford's Programming Abstractions course, I come across some piece of code
While I'm developing Android-Apps I like to have a look at internal SDK implementations.
While database design I used a field name deleted and use it as Boolean.
While validating my website's HTML code in the W3C validator I got the following
While debugging my NServiceBus enabled application, I have certain messages that are reported in
While it's very handy, I very rarely, if ever, come across functions that return
While editing and fixing up code I have thought that sometimes it would be

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.