50%(8)4 out of 8 people found this document helpful
This preview shows page 2 - 5 out of 5 pages.
J.) Pollock14NLARIArizona Diamondbackspolloaj01A. J.PollockAllen Lorenz (A.J.) Pollock20NLARIArizona Diamondbacksmartijd02J. D.MartinezJulio Daniel (J. D.) Martinez29NLATLAtlanta Bravessurhobj01B. J.SurhoffWilliam James (B. J.) Surhoff109.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.playeridFull NameteamID bucktr01Travis George (Travis) BuckOAKellsbja01Jacoby McCabe (Jacoby) EllsburyBOSescobyu01Yunel (Yunel) EscobarATL10. 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 aCAST function changing the output to a fixed decimal format. playeridSum_Batting_AverageBatting_Averageaardsda010.00000.0000aaronha010.30500.3011aaronto010.22880.2207