bot50
2026-04-28 13:10:07 +00:00
commit 28ebaeaf0b
12 changed files with 32 additions and 0 deletions

8
1.sql Normal file
View File

@@ -0,0 +1,8 @@
-- write a SQL query to find the average player salary by year.
-- Sort by year in descending order.
-- Round the salary to two decimal places and call the column “average salary”.
-- Your query should return a table with two columns, one for year and one for average salary.
SELECT "year", ROUND(AVG("salary"), 2) AS "average salary"
FROM "salaries"
GROUP BY "year"
ORDER BY "year" DESC;

0
10.sql Normal file
View File

0
11.sql Normal file
View File

0
12.sql Normal file
View File

9
2.sql Normal file
View File

@@ -0,0 +1,9 @@
-- 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 s."year", s."salary"
FROM "salaries" AS s
JOIN "players" AS p
ON s."player_id" = p."id"
WHERE p."first_name" = "Cal" AND p."last_name" LIKE "Ripken%"
ORDER BY "year" DESC;

15
3.sql Normal file
View File

@@ -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;

0
4.sql Normal file
View File

0
5.sql Normal file
View File

0
6.sql Normal file
View File

0
7.sql Normal file
View File

0
8.sql Normal file
View File

0
9.sql Normal file
View File