bot50
2026-04-30 07:15:06 +00:00
commit 4fced5d8c8
12 changed files with 204 additions and 0 deletions

13
4.sql Normal file
View File

@@ -0,0 +1,13 @@
-- write a SQL query to find the 50 players paid the least in 2001.
-- Sort players by salary, lowest to highest.
-- If two players have the same salary, sort alphabetically by first name and then by last name.
-- If two players have the same first and last name, sort by player ID.
-- Your query should return three columns, one for players first names, one for their last names, and one for their salaries.
SELECT
p."first_name", p."last_name", s."salary"
FROM "players" AS p
JOIN "salaries" AS s
ON s."player_id" = p."id"
WHERE s."year" = "2001"
ORDER BY s."salary" ASC, p."first_name" ASC, p."last_name" ASC, p."id" ASC
LIMIT 50;