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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:23:09+00:00 2026-05-27T04:23:09+00:00

I had a question about the best way to handle this type of data.

  • 0

I had a question about the best way to handle this type of data.

In my system, I will have many users and many accounts… users are able to belong to many accounts, and accounts will have many users. I’m guessing the best way to accomplish this is with three tables

users

accounts

& users_accounts

my question is, when someone signs up for a paid account… where should I store the flag that distinguishes between regular users of an account and account holders? Should there be an owner flag in the users_accounts table?

  • 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-27T04:23:10+00:00Added an answer on May 27, 2026 at 4:23 am

    Can I assume that one account cannot have more than one user (1-to-many relation)? In that case, two tables would be sufficient:

    • users
    • accounts

    Where accounts contain a reference to a user id. A separate relationship table would be superfluous when there is no many-to-many relation.

    Then the question arises: can a user have both paid and unpaid accounts? If so, the flag belongs in accounts. Otherwise, it belongs in users.


    Taking your clarification into account, your three tables design is appropriate. The answer to your question then completely depends on how you want paid accounts to work.

    • Will a paid user have extra functionality in all accounts? Then the flag belongs in users.
    • Will any user have extra functionality in a paid account? Then the flag belongs in accounts.
    • Will a paid user have extra functionality only in paid accounts? Then the flag belongs in users_accounts.

    If every account has only one owner, then you should put a user id representing the owner in the accounts table.

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

Sidebar

Related Questions

This is a question about the best way to add up a series of
I have a question and I'm not sure about the best way to design
I had a question about Java Class Path variables. If I have multiple jars
I had this working at some point, as I had a question about this
I really like Play 2.0's form mapping system, but I had a question about
Note: I had another similar question about how to GZIP data using Ruby's zlib
I posted this question on the django-users list, but haven't had a reply there
I have already read this question which talks about the same thing but I
I have a base type which stores information about a question in a question
In my previous question on this portal, I had asked about some insight about

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.