I think what you’re looking for is to do this kind of query:
Get people where Subject1 = math OR Subject2 = math OR Subject3 = math
Assuming you’re connecting to the data using datasets, you would use the dataset.setFilter API
So you would forumulate that kind of query using OR statements