Database: MySQL
Table: Teams
TeamID INT
TeamName VARCHAR(20)
Table: People
PeopleID INT
FirstNameID INT
LastNameID INT
Table: TeamMembers
TeamID INT
PeopleID INT
Table Example: Teams
TeamID TeamName
1 Team Xstream
2 Team INsanity
Table Example: People
PeopleID FirstNameID LastNameID
1 1351 453
2 5463 763
3 976 8762
4 87 784
5 187 465
6 761 566
7 376 2134
Table Example: TeamMembers
TeamID PeopleID
1 1
1 3
1 7
2 2
2 4
2 5
2 6
Desired Output:
TeamName TeamMembers
Team Xstream John Smith/Jane Doe/Daniel Davis
Team INsanity Sally Sue/Tom Thomas/Jack Jones/Harry Henderson
There will not be a set number of TeamMembers per team, so it's not like I could have three subqueries because there will only be three team members. I've lightly looked online, but I always get the best and most thorough answers here. Any ideas or pointers, please let me know. I honestly have no idea where to begin here. Thanks.