J Pollock 14 NL ARI Arizona Diamondbacks polloaj01 A J Pollock Allen Lorenz A J

# J pollock 14 nl ari arizona diamondbacks polloaj01 a

• 5
• 50% (8) 4 out of 8 people found this document helpful

This preview shows page 2 - 5 out of 5 pages.

J.) Pollock 14 NL ARI Arizona Diamondbacks polloaj01 A. J. Pollock Allen Lorenz (A. J.) Pollock 20 NL ARI Arizona Diamondbacks martijd02 J. D. Martinez Julio Daniel (J. D.) Martinez 29 NL ATL Atlanta Braves surhobj01 B. J. Surhoff William James (B. J.) Surhoff 10 9.Using the appropriate Set Operator (slide 32), write a query using the PEOPLE and SALARIES tables and only show players who’s name does not contain a period (.) and who played for the same team in 2008 and 2010 had a salary between \$400,000 and \$500,000 in both those years. The results must also be sorted by Salary and then Last Name. You must use a BETWEEN clause in your with statement and a
INTERSECT statement. Your output should show the nameGiven, nameFirst and nameLast into an additional single column called Full Name and the teamid that they played for .HINT:You need to create 2 separate queries (one to select the data for each year, and use the SET Operator to combine the data to get the correct results. You can also refer to the Relational Algebra Chapter for additional information regarding how the set operators work. playerid Full Name teamID bucktr01 Travis George (Travis) Buck OAK ellsbja01 Jacoby McCabe (Jacoby) Ellsbury BOS escobyu01 Yunel (Yunel) Escobar ATL 10. Write a query that calculates the career batting average of players in 2 different ways. Batting Hints: You will get all 0’s for answers unless you convert the INT format to float. You can do this by multiplying the integer column by 1.0. You also need to properly format the Batting Averages using a CAST function changing the output to a fixed decimal format. playerid Sum_Batting_AverageBatting_Average aardsda01 0.0000 0.0000 aaronha01 0.3050 0.3011 aaronto01 0.2288 0.2207