Neuvádíte svůj RDBMS, takže zde je v MySQL
DELETE teammembers FROM teammembers
JOIN teams on teammembers.teamId = teams.teamId
WHERE teams.eventId = 1
Neuvádíte svůj RDBMS, takže zde je v MySQL
DELETE teammembers FROM teammembers
JOIN teams on teammembers.teamId = teams.teamId
WHERE teams.eventId = 1