Doubtful about the SQL queries. Here are some more workarounds IF I understand what you are trying to do. I am assuming you use the schedule or it would be rather easy to do it that way.
But, glancing at the search functions, it seems you could use either Phone, Medications or Diagnosis.
For instance, if you didn't use the work phone field (which admittedly may be tough to give up -- but you could put it elsewhere in a miscellation field, you could put a phone number for each team such as 222-2222 in the demographics of a patient belonging to that team. A search on 222-2222 would yield all of the patients.
You could use the name of the team or doctor for a medication. Sure, you would have a weird medicine name in the list, but a quick search on that "medication" would yield all the names.
Finally, you could make up a new ICD-9 code with the team name and just search on that diagnosis.
You can also search on provider seen. But that would be after the fact.