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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:20:50+00:00 2026-05-23T10:20:50+00:00

I want users to be able to select their majors. For example, person A

  • 0

I want users to be able to select their majors.

For example, person A could select computer science, mathematics, and history as his majors. Users can select any number of majors.

I have a list of organizations in my database that would only accept students if they are of a particular major. For example, Organization A only accepts computer science and mathematics majors. Organizations can select any number of majors.

I want to match students to the organizations that fit their majors. For example, I want to search the database for organizations that accept one or more of Person’s A majors, which are computer science, mathematics, and history. Organizations that accept all or most of Person’s A majors would be listed first. So if Organization B accepts all three of Person’s A majors but Organization A only accepts two of Person’s A majors, Organization B would be listed first.

How can I store the majors that the organizations accept in the mysql database? How can I store students’ majors to allow for efficient matching between student information and organization information?

I was considering storing all the majors that organizations accept as a serialized values in the database.

So I have 2 tables

Organizations
ID int
name varchar(255)
majors_accepted blob

Students
ID int
name varchar(255)
majors blob

I could store the majors that organizations accept as serialized values in the majors_accepted blob. There could be more than 1 major in that field.

Or I could store the majors that students are considering as serialized values in the majors field in the Students table. There could be more than 1 major in that field. Then I guess I could go over all the rows in the organizations table and compare each majors_accepted field with the students data. But that seems inefficient…

  • 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-23T10:20:50+00:00Added an answer on May 23, 2026 at 10:20 am

    I would do it like this:

    1. create a majors table – has a majorID and a majorName
    2. create an association table between students and majors that has a studentID and a majorID.
    3. create an association table between organizations and majors that has an orgID and a majorID.

    It’s not good database design to store more than one value in a field like what you’re trying to do with your blobs, so break it out like this, and you can do all the queries necessary to determine which organizations a student can join by just joining tables.

    Let’s say you’re looking for the organizations that one particular student can join (we’ll say studentID for this student is 1):

    SELECT Students.ID,
           Organizations.name
    FROM Students 
    INNER JOIN StudentsMajors ON Students.ID = StudentsMajors.studentID
    INNER JOIN OrganizationsMajors ON StudentsMajors.majorID = OrganizationsMajors.majorID
    INNER JOIN Oranizations ON OrganizationsMajors.orgID = Organizations.ID
    WHERE Students.ID = 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user that want to be able to select a textbox and
Similar Stack Overflow Question I want users to be able to search through my
In my Rails app I want users to be able to input video links
There's this Excel file I want users to be able to download from my
I have an app where we want users to be able to send us
I have some pages that I don't want users to be able to access
I have several WPF apps, and I want users to be able to log
I want my users to be able to do a rubberband selection in a
I'm writing a small blog module. I want the users to be able to
I want only a (faculty) group of users to be able to access a

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.