Files
me50/5.sql

10 lines
380 B
SQL

-- write a SQL query to find all teams that Satchel Paige played for.
-- Your query should return a table with a single column, one for the name of the teams.
SELECT DISTINCT t."name"
FROM "teams" AS t
JOIN "performances" AS perf
ON perf."team_id" = t."id"
JOIN "players" AS p
ON p."id" = perf."player_id"
WHERE p."first_name" = "Satchel" AND p."last_name" = "Paige";