Files
me50/3.sql
2026-04-28 15:40:19 +02:00

16 lines
556 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- write a SQL query to find Ken Griffey Jr.s home run history.
-- Sort by year in descending order.
-- Note that there may be two players with the name “Ken Griffey.” This Ken Griffey was born in 1969.
-- Your query should return a table with two columns, one for year and one for home runs.
SELECT perf."year", perf."hr"
FROM "performances" AS perf
JOIN "players" AS p
ON perf."player_id" = p."id"
WHERE
p."first_name" = "Ken"
AND
p."last_name" LIKE "Griffey%"
AND
p."birth_year" = "1969"
ORDER BY "year" DESC;