From 3f32b9343f43e95b7107b134ce9a425e291df868 Mon Sep 17 00:00:00 2001 From: daviddoji Date: Wed, 15 Apr 2026 11:01:52 +0200 Subject: [PATCH] automated commit by check50 [check50=True] --- 10.sql | 5 +++++ 8.sql | 2 +- 9.sql | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/10.sql b/10.sql index e69de29..229dd67 100644 --- a/10.sql +++ b/10.sql @@ -0,0 +1,5 @@ +-- write SQL query to answer a question of your choice. This query should: + -- Make use of AS to rename a column + -- Involve at least condition, using WHERE + -- Sort by at least one column using ORDER BY +SELECT ROUND(AVG("weight"), 2) AS "Average Weight" FROM "players" WHERE "birth_year" > 2000 ORDER BY "first_name"; diff --git a/8.sql b/8.sql index 5eec52f..53dc24b 100644 --- a/8.sql +++ b/8.sql @@ -1,3 +1,3 @@ -- write a SQL query to find the average height and weight, rounded to two decimal places, of baseball players who -- debuted on or after January 1st, 2000. Return the columns with the name “Average Height” and “Average Weight”, respectively. -SELECT ROUND(AVG("height"), 2) AS "Average Height", ROUND(AVG("weight"), 2) AS "Average Weight" FROM "players" WHERE "debut" > "2000-01-01"; +SELECT ROUND(AVG("height"), 2) AS "Average Height", ROUND(AVG("weight"), 2) AS "Average Weight" FROM "players" WHERE "debut" >= "2000-01-01"; diff --git a/9.sql b/9.sql index 857b2d9..02e11fa 100644 --- a/9.sql +++ b/9.sql @@ -1,2 +1,3 @@ -- write a SQL query to find the players who played their final game in the MLB in 2022. -- Sort the results alphabetically by first name, then by last name. +SELECT "first_name", "last_name" FROM "players" WHERE "final_game" LIKE "2022%" ORDER BY "first_name" ASC, "last_name" ASC;