Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Now you decide to pull all the information youve developed together. Write a query that shows the players Total_bases_touched from question #5, the batting_averages from

Now you decide to pull all the information youve developed together. Write a query that shows the players Total_bases_touched from question #5, the batting_averages from #9 (between .2and .4999) and the players name as formatted in #8. You also want to add the teamid and the teams batting average for the year. The teams batting average should be calculated using the columns with the same names, but from the TEAMS table. As a final piece of information, calculate the percentage of the teams batting average divided by the players batting average. Also replace the Teamid with the team name in your ourput. Note, a percentage over 100% indicates the player is better than the average batter on the team. Additionally, rename the tables to only use the first letter of the table so you can use that the select and where statement (ex: FROM TEAMS T). This saves a considerable amount of typing and makes the query easier to read. Order the results by batting average in descending order then playerid and yearid id ascending order. Also, eliminate any results where the player has an AB less than 50. Your query should return 44,493 rows. playerid Fullname yearid Team Total_Bases_ Batting Team Batting % of Team Name Touched Average Average BA meyerle01 Levi Samuel ( Levi ) Meyerle 1871 Philadelphia Athletics 109 0.4923 0.3201 153.82% duffyhu01 Hugh ( Hugh ) Duffy 1894 Boston Beaneaters 525 0.4397 0.3309 132.89% oneilti01 James Edward ( Tip ) O_Neill 1887 St. Louis Browns 492 0.4352 0.3071 141.74%

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions