From 1f5635d66409b2515b02e584baa85964e0eaefab Mon Sep 17 00:00:00 2001 From: daviddoji Date: Tue, 28 Apr 2026 15:10:03 +0200 Subject: [PATCH] automated commit by check50 [check50=True] --- 2.sql | 2 +- 3.sql | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/2.sql b/2.sql index 7b25cfa..f672ed0 100644 --- a/2.sql +++ b/2.sql @@ -1,7 +1,7 @@ -- write a SQL query to find Cal Ripken Jr.’s salary history. -- Sort by year in descending order. -- Your query should return a table with two columns, one for year and one for salary. -SELECT "year", "salary" +SELECT s."year", s."salary" FROM "salaries" AS s JOIN "players" AS p ON s."player_id" = p."id" diff --git a/3.sql b/3.sql index e69de29..b84b33e 100644 --- a/3.sql +++ b/3.sql @@ -0,0 +1,15 @@ +-- 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;