16 lines
556 B
SQL
16 lines
556 B
SQL
-- 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;
|