Files
me50/8.sql
2026-04-28 16:05:16 +02:00

10 lines
367 B
SQL

-- write a SQL query to find the 2001 salary of the player who hit the most home runs in 2001.
-- Your query should return a table with one column, the salary of the player.
SELECT s."salary"
FROM "salaries" AS s
JOIN "performances" AS perf
ON perf."player_id" = s."player_id"
WHERE s."year" = '2001' AND perf."year" = '2001'
ORDER BY perf."HR" DESC
LIMIT 1;