Files
me50/2.sql
2026-04-28 15:10:03 +02:00

10 lines
379 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 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;