Question: The following are problems you are to solve using Aggregate functions . DO NOT USE TOP . Provide both the answers to the questions and
The following are problems you are to solve using Aggregate functions. DO NOT USE TOP. Provide both the answers to the questions and Selects. You will likely need to watch my recorded lecture to complete some of the problems.
Include column headers!
Change the color of your answers to red so they stand out.
Add your answers in the space below the problem. Dont renumber problems. Upon completion, drop the completed Word Doc into the drop box without zipping.
Using the Baseball DB (2 points each after 1)
Reread the instructions above!
How many players are in the Baseball players table? ___20,370___ Select: select * from dbo.players
How many players were born in the city of Portland, OR? __81_____ Select: select * from players
WHERE birthCity= 'portland';
How many players that threw left-handed and weighed more than 200 pounds were born in Texas?______ Select: the following are progressive changes (Build on each other) from problem 4:
and died after Jan 1, 1900 (dates go in apostrophes) ______ Select:
and batted left-handed _______ Select
Modify your statement to include the States of California, Lousiana, Texas, New Mexico, and Arizona _________ Select:
How many players that we know are deceased had a final game before 1/1/1920? ____ Select:
How many players were born and died in the State of Washington? _____ Select:
Using the Salaries table and a single statement, how many players, what was the total payroll AND average salary of the Seattle Mariners (TeamID: SEA) in 2010? ____ Select:
Using the salaries table, how many years of salary data are maintained by the Mariners? (Hint: https://www.w3resource.com/sql/aggregate-functions/count-with-distinct.php) ____ Select:
Using the Contributions table How many donations were made from Spokane, WA? ____ Select:
What were the average, total, and largest donations made from the zip code where you reside? ____ Select:
Using the Weather Database and Spokane2022 table:
What are the hottest and coldest temperatures ever recorded in Spokane (single statement)? ? ____ Select:
What is the overall average daily temperature in Spokane? (mean daily mean) ? ____ Select:
What is the average of all low temperatures in Celcius? ____
To convert temperatures in degrees Fahrenheit to Celsius, subtract 32 and multiply by .5556 (or 5/9). Select:
How many record lows were recorded in the year 1888? Be careful and test your results. ____ Select:
What is the most recent year that a record high was recorded? ____ Select:
More Challenging (follow my instructions in the video). You will use multiple Selects embedded into one statement
Which Mariner (just PlayerID) had the greatest salary in 2012? Hint: First find the greatest Mariner salary for 2012. Then find the PlayerID with the salary for 2012. If you watch the course videos you know how to now combine them into a single statement. ____ Select:
Who, according to birthdate, was the earliest player ever to play Major League Baseball? ________________ Select:
Which living players, those without a date of death, have the same weight as the all-time average for baseball? ____ Select: I need to get the select statements including column headers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
