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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:15:07+00:00 2026-05-12T08:15:07+00:00

In part of a website I am designing, there is a section that will

  • 0

In part of a website I am designing, there is a section that will have both predefined values and the option to specify custom values.

As a simpler example, let’s assume that the values are “Sports” and that the application has predefined sports, but that some users will want to enter their own since I can’t predict everything that they will come up. Users won’t have access to the sports that others have entered, only their own.

Should the predefined sports and the custom sports be stored in the same table? In this case, I either have to allow a user_id column in that table to be null, or create a user and user_id for the predefined sports.

Most of the time when searching for a sport by name I will want to search both predefined and the user’s own custom sports, so if the predefined and custom sports are separated, I would still have to have the search go across both tables.

On the other hand, if they are separated, it makes it harder to specify foreign key relationships based on a sport_id.

What is a good way to approach this type of situation?

  • 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-12T08:15:08+00:00Added an answer on May 12, 2026 at 8:15 am

    I don’t see a problem including both predefined and custom values in a table (perhaps you could use a bit flag to indicate “custom,” in case you need to do something with them later). And you could easily specify an identity value as the primary key in that table, so there should not be an issue with specifying foreign key relationships.

    The only issues you’re going to have are dupes and mispellings.

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

Sidebar

Related Questions

There is a part of my website that allows users to upload profile photos.
I have written a basic website that calculates SHA1 hashes. I know, there are
Suppose that we have a website. We want to show a specified part of
I am creating an part of a website that deals with confirmation of a
I have a website a part of which should be blocked with a login
I'm creating a ASP.NET .NET 4.0 website and part of this site requires that
I have a web service setup for on a small part of a website
I have a script that updates information of my website, it loads the date
We're in the process of designing a tiny database that will contain data regarding
Hello, I have a website part described as below: <div id=insertA> <form class=MultiFile-intercepted enctype=multipart/form-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.