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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:29:55+00:00 2026-06-17T11:29:55+00:00

I have two tables. User_types (1)individual (2)business (3)student Relationship_cat cat_id cat_name user_id user_type First

  • 0

I have two tables.

User_types

  • (1)individual
  • (2)business
  • (3)student

Relationship_cat

  • cat_id
  • cat_name
  • user_id
  • user_type

First with Relationship_cat, i want an entry to look like this

cat_id(1), cat_name(interests) ,user_id(ANy user), user_type(only 1 and 3)
cat_id(2), cat_name(news) ,user_id(ANy user), user_type(only 2 and 3)
etc

With user_type i believe i could set it to 0 as default so it’s not constrained to any user. How do I go about the "relationship_cat > user_type" case? Do I use a comma separated list of values? Is it efficient? And what if there are many User_types entries increase?

  • 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-17T11:29:56+00:00Added an answer on June 17, 2026 at 11:29 am

    You should use a many-to-many join table. So your schema might look like this:

    user_types

    • user_type_id
    • user_type_value

    categories

    • cat_id
    • cat_name

    categories_to_user_types

    • cat_id
    • user_type_id

    Any time you may think about using comma-separated values like you mentioned, this should be a sign to you to further normalize your tables. What I have shown is typically the best way to express a many-to-many relationship between tables.

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

Sidebar

Related Questions

I have two tables: colleges (id) and users_colleges (user_id, college_id) I want to select
I have two tables like of this structure: content (content_id, content_type, user_id, time, comment_count)
I have two tables user table user_id | name | 1 | peter |
I am facing a situation and need help. I have two tables: user: user_id
Say I have two tables User ----- id first_name last_name User_Prefs ----- user_id pref
I have two tables. Table user contains user_id, user_name. Table Transactions contains user_id, transactions
I have two tables user and email. One user can have multiple emails so
I have two tables user and log. I would like to join the user
I have two sql tables for user login, store and retrieve data according to
I have two tables in my database: user and media_contact . The media_contact table

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.