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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:37:43+00:00 2026-06-16T03:37:43+00:00

The site I’m working on has 3 different types of users: admin, applicants, reviewers.

  • 0

The site I’m working on has 3 different types of users: admin, applicants, reviewers. Each of these groups will have some basic info that will need to be stored (name, id, email, etc) as well as some data that is unique to each. I have created a users table as well as a table for each of the specific groups to store their unique data.

  • users: id, f_name, l_name, email, user_type
  • users_admin: id, user_id, office, emp_id
  • users_applicant: id, user_id, dob, address
  • users_reviewer: id, user_id, active_status, address, phone

If a user with user_type of “1” (applicant) logs in I will need to JOIN to the users_applicants table to retrieve their full record. I tried using a UNION but my tables have vastly different columns.

Is there a way to, based on a user’s type, write a conditional query that will JOIN to the correct table? Am I going about this completely the wrong way?

Thank’s in advance for your help!

  • 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-16T03:37:43+00:00Added an answer on June 16, 2026 at 3:37 am

    Well, in the end your tables are already flawed. Why even have a table for each type? Why not put all those fields into the users table, or maybe a user_details table (if you really want an extra table for non-general data fields)? Currently, you’re actually creating 4 independent user tables from a relational point of view.

    So why do the type-tables have a surrogate key? Why isn’t the user_id already the (only) primary key?

    If you changed that, all you would need is the user id to retrieve the data you want, and you’ve already got that (or you wouldn’t even be able to retrieve the user type).

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

Sidebar

Related Questions

Site for writers and readers, both groups will be non-technical users (writers will be
The site I'm currently working on has a series of videos on a carousel
The site I'm working on has a database table filled with glossary terms. I
My site has the following url format: www.mysite.com/Display.aspx?ID=128 However most users see the url
The site I'm working on is using the Frontpage module to redirect anon users
My site has three columns. I have two fields within a form that need
Site: http://clientfiles.priworks.com/lgmanagedportfolios/test/investment.html I have been working at this web page for a while now
SITE ADMIN: WOULD YOU PLEASE REMOVE THIS POST? For example, I have tt =
Our site is an image repository of sorts. Each image has the notion of
A site I'm working on has Flash headers (using swfobject to embed them). Now

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.