you MUST replace UCID with your UDIC. For example, the view name in question 1 should...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
you MUST replace UCID with your UDIC. For example, the view name in question 1 should look something like Player_Summary_ST235. Make sure you submit all 3 required answers 1. Using the People, CollegePlaying, Batting and other tables indicated below, create a view named NJITID_Player_History that contains: playerID Player Full Name, Total 401K amount from the People table Number of yrs played from the Batting table Number of Teams played for the Batting table Career Total Home Runs from Batting Career Batting Average (calculate the Batting Average using all the data for the player) Total Salary Average Career Salary Starting Salary from the Salaries table Ending Salary from the Salaries table Career percentage of salary increase (percent difference in starting and ending salary) Year Last played in College from the CollegePlaying Table (if they attended college) Number of Schools attended from the CollegePlaying Table. The value should be 0 if the player didn't attend college Last Year Played from Batting Career Total of Wins from Pitching Table Career Total of Strike Outs (SO) from the Pitching Table Career Power Fitness Ratio (statistical measure of the performance of a pitcher. It is the sum of strikeouts (SO) and walks (BB) divided by sum of innings pitched (IPouts/3) from the Pitching Table Total games played (G) from the Fielding Table Total games started (GS) from the Fielding Table Percent of Total Games Played (you need to calculate this value by dividing the Total Games Played by the number of games in their career. The number of games in their career can be calculated using the summing G column in the Teams Table for the years the player played) Total Number of Awards as a player from AwardsPlayer and AwardsSharePlayer Total number of Awards as a manager from AwardsManager and AwardsShareManager Year Inducted in the Hall of Fame # of times nominated for the hall of fame but not inducted (# of rows where inducted = 'N') Hall of Fame (Yes or No) as an indicator if the player was actually elected to the Hall of Fame playerid tot games Berdede01 331 Baronhe01 3020 seronto 2. 3. 387 Note on Dates: For dates, do not use the Debut and FinalGame columns from the PEOPLE table. There are problems with the data and they will cause incorrect calculations. Instead use Min(YearID) and Max(yearid) from the appropriate table to get correct dates. Remember to check your answers. Due to the data, if you do not associate the tables properly, you will lose results. You should end up with the same number of rows in the results as the number of rows in the PEOPLE table. You do not have to have the exact correct number of rows because of the amount of work involved to get things 100% correct, but (and no pun intended,) you should be in the ballpark! (+/- 2000 rows). 15 points will be taken off if your answer does not contain all the required columns. I recommend breaking the required columns up into pieces and use WITH statements or subqueries to create each part. Use left joins to ensure data is not dropped due to all players not having information in all tables. Sample for query #1 Total 401K fullname tot GS perc_start David David Allen) Aardsma 337122.50 0 0.000000000000 Hank Henry Louis) Aaron NULL 2977 0.835297418630 Tommiel Tommie Lee Aaron 206 0.141289437585 Your view must return 20, 370 rows, If you have less than that number, you are not coding the LEFT JOINS properly, If you have more than that number, you have a subquery that is returning more than 1 row per player. To find the problem subquery, run the following: select from [your view name] order by playerid select playerid, count(") from [your view name] group by playerid having count(") > 1 order by playerid By looking at the view results for the columns that have different values for the same playerid will show you the subquery(s) giving multiple results. After creating your view write the following queries using your view. Make sure you have a GO statement in between the SQL for creating the view and the following 2 select statements: Select all the columns in your view Write a query that calculates the average of the [# of yrs played], the average of the Average Salaries and the averages of the Career Batting Averages of all players who's last name begins with the letter A using the information in the view. num_years num_teams runs tot award play tot_award man 9 E NULL 23 36 NULL NULL 7 NULL career_ba 0 NULL 753 NULL 2 NULL 0.000000 0.304998 13 0 tot sel year 9258750.00 NULL NULL 1982 0.228813 N min_Salarymax salary perct incr count inducted 13228214285 30000000 4000000.00 0.9333333333333333 avg_sa 0 NULL 0 NULL N NULL Y NULL NULL NULL NULL NULL NULL Num schools 2 NULL NULL max_col 2003 NULL NULL max_appear tot so 2015 1976 1971 340 NULL NULL tot win 16 NULL NULL car_pfr 0.172436 NULL NULL Based 448 Don Donald William) Asse 233000.00 13 91 0.044411908247 NULL Sample Answer for query #2 averageSal Avg YrsPlayed 5 careerba 3 NULL 0 ON NULL 0.000000 0 2300000.00 375000.00 400000.00 N $1,332,182.83 673000.00 0.4074074074074074 0.1878 NULL NULL 1990 0.109975 you MUST replace UCID with your UDIC. For example, the view name in question 1 should look something like Player_Summary_ST235. Make sure you submit all 3 required answers 1. Using the People, CollegePlaying, Batting and other tables indicated below, create a view named NJITID_Player_History that contains: playerID Player Full Name, Total 401K amount from the People table Number of yrs played from the Batting table Number of Teams played for the Batting table Career Total Home Runs from Batting Career Batting Average (calculate the Batting Average using all the data for the player) Total Salary Average Career Salary Starting Salary from the Salaries table Ending Salary from the Salaries table Career percentage of salary increase (percent difference in starting and ending salary) Year Last played in College from the CollegePlaying Table (if they attended college) Number of Schools attended from the CollegePlaying Table. The value should be 0 if the player didn't attend college Last Year Played from Batting Career Total of Wins from Pitching Table Career Total of Strike Outs (SO) from the Pitching Table Career Power Fitness Ratio (statistical measure of the performance of a pitcher. It is the sum of strikeouts (SO) and walks (BB) divided by sum of innings pitched (IPouts/3) from the Pitching Table Total games played (G) from the Fielding Table Total games started (GS) from the Fielding Table Percent of Total Games Played (you need to calculate this value by dividing the Total Games Played by the number of games in their career. The number of games in their career can be calculated using the summing G column in the Teams Table for the years the player played) Total Number of Awards as a player from AwardsPlayer and AwardsSharePlayer Total number of Awards as a manager from AwardsManager and AwardsShareManager Year Inducted in the Hall of Fame # of times nominated for the hall of fame but not inducted (# of rows where inducted = 'N') Hall of Fame (Yes or No) as an indicator if the player was actually elected to the Hall of Fame playerid tot games Berdede01 331 Baronhe01 3020 seronto 2. 3. 387 Note on Dates: For dates, do not use the Debut and FinalGame columns from the PEOPLE table. There are problems with the data and they will cause incorrect calculations. Instead use Min(YearID) and Max(yearid) from the appropriate table to get correct dates. Remember to check your answers. Due to the data, if you do not associate the tables properly, you will lose results. You should end up with the same number of rows in the results as the number of rows in the PEOPLE table. You do not have to have the exact correct number of rows because of the amount of work involved to get things 100% correct, but (and no pun intended,) you should be in the ballpark! (+/- 2000 rows). 15 points will be taken off if your answer does not contain all the required columns. I recommend breaking the required columns up into pieces and use WITH statements or subqueries to create each part. Use left joins to ensure data is not dropped due to all players not having information in all tables. Sample for query #1 Total 401K fullname tot GS perc_start David David Allen) Aardsma 337122.50 0 0.000000000000 Hank Henry Louis) Aaron NULL 2977 0.835297418630 Tommiel Tommie Lee Aaron 206 0.141289437585 Your view must return 20, 370 rows, If you have less than that number, you are not coding the LEFT JOINS properly, If you have more than that number, you have a subquery that is returning more than 1 row per player. To find the problem subquery, run the following: select from [your view name] order by playerid select playerid, count(") from [your view name] group by playerid having count(") > 1 order by playerid By looking at the view results for the columns that have different values for the same playerid will show you the subquery(s) giving multiple results. After creating your view write the following queries using your view. Make sure you have a GO statement in between the SQL for creating the view and the following 2 select statements: Select all the columns in your view Write a query that calculates the average of the [# of yrs played], the average of the Average Salaries and the averages of the Career Batting Averages of all players who's last name begins with the letter A using the information in the view. num_years num_teams runs tot award play tot_award man 9 E NULL 23 36 NULL NULL 7 NULL career_ba 0 NULL 753 NULL 2 NULL 0.000000 0.304998 13 0 tot sel year 9258750.00 NULL NULL 1982 0.228813 N min_Salarymax salary perct incr count inducted 13228214285 30000000 4000000.00 0.9333333333333333 avg_sa 0 NULL 0 NULL N NULL Y NULL NULL NULL NULL NULL NULL Num schools 2 NULL NULL max_col 2003 NULL NULL max_appear tot so 2015 1976 1971 340 NULL NULL tot win 16 NULL NULL car_pfr 0.172436 NULL NULL Based 448 Don Donald William) Asse 233000.00 13 91 0.044411908247 NULL Sample Answer for query #2 averageSal Avg YrsPlayed 5 careerba 3 NULL 0 ON NULL 0.000000 0 2300000.00 375000.00 400000.00 N $1,332,182.83 673000.00 0.4074074074074074 0.1878 NULL NULL 1990 0.109975
Expert Answer:
Answer rating: 100% (QA)
It appears you have shared details for a database assignment that requires creating a view named after a students university ID NjITIDPlayerHistory co... View the full answer
Related Book For
Financial Accounting and Reporting a Global Perspective
ISBN: 978-1408076866
4th edition
Authors: Michel Lebas, Herve Stolowy, Yuan Ding
Posted Date:
Students also viewed these databases questions
-
A partnership firm earned net profits during the last three years as follows: 1986- Rs. 17,000; 1987- Rs. 20,000; 1988- Rs. 23,000. The capital investment in the firm throughout the above mentioned...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
What type of isomers are exhibited by [Fe(en) 3 ]Cl 2 (en = ethane-1,2-diamine)? no isomers are possible. cis and trans isomers fac and mer isomers optical isomers
-
Compressible pipe flow with heat addition, Sec. 9.8, assumes constant momentum (p + V2) and constant mass flow but variable stagnation enthalpy. Such a flow is often called Rayleigh flow, and a line...
-
A square matrix P is called an idempotent if P2 = P. Show that: If P is an idempotent, so is Q = P + AP - PAP for any square matrix A (of the same size as P).
-
At the beginning of the year 2013, Company XYZ had an inventory of 8,000 widgets with a unit cost of \(\$ 6.00\). During that year, the following purchases of widgets were made: At the end of 2013,...
-
Presented below are the computed amounts of ratios for the Village of Riverside example appearing in the chapter. * Population and property values are disclosed in the statistical section of the...
-
An aerobatic airplane pilot experiences weightlessness as she passes over the top of a loop-the-loop maneuver. The acceleration of gravity is 7.8 m/s 2 . If her speed is 470 m/s at this time, find...
-
A Y-connected load, with Z A = 10 0 , Z B = 10 60, and Z C = 10 60 , is connected to a three-phase, three-wire, ABC system having effective line voltage 141.4 V. Find the load voltages V AO , V BO...
-
A child was looking for his father. He went 90 m in the east before turning to his right. he went 20 m before turning to his right afain to lok for his father at his uncles place 30 m from this...
-
In a group of 100 people, 50 earned A's in their math course and 50 earned B's. Of the people that earned A's, it is determined that 10 of them went to a math tutor and 2 of those with B's also went...
-
At the Iron Bank, 62% of customers have checking accounts, 24% have savings accounts, and 17% have both checking and savings accounts. Of the Iron Bank customers who hold checking accounts, what...
-
DISCUSSION : 1. Target Markets of Giizghigat Maple Products. 2. Promotion Strategy of of Giizghigat Maple Products. 3. Explain 2 ways to assess the effectiveness of your promotional plan. PLEASE...
-
Suppose it were possible to invest $13000 in a savings account that pays an APR of 10% for 5 years. a) What is the value of the savings account if the interest is compounded monthly? b) What is the...
-
Compare and contrast some of the contextual factors that might arise for a social worker who is working in a public, governmental organization versus one who works in the same role at a privately...
-
How do nerves control every organ and function in the body?
-
Find the velocity, acceleration, and speed of a particle with the given position function. r(t) = (t 2 , sin t - t cos t, cos t + t sin t), t > 0
-
Are there possible conflicts of interests between the various users of financial information? If your answer is yes, please provide some illustrations; if your answer is no, explain why.
-
Transactions related to Ives Companys shareholders equity (far left column) are listed in the following table. For each line you are provided with three choices of impact of the transaction on the...
-
Corelli Company provides below a listing (in alphabetical order) of all the accounts it uses (far left column). For each line you are provided five choices of families of accounts to which the...
-
Consider the Gompertz model in Eq. (12.35). Graph the expectation function for \(\theta_{1}=1, \theta_{3}=1\), and \(\theta_{2}=\frac{1}{8}, 1,8,64\) over the range \(0 \leq x \leq 10\). Equation...
-
Consider the following observations: a. Fit the nonlinear regression model \[ y=\theta_{1} e^{\theta_{2} x}+\varepsilon \] to these data. Discuss how you obtained the starting values. b. Test for...
-
Consider the model \[ y=\theta_{1}-\theta_{2} e^{-\theta_{3} x}+\varepsilon \] This is called the Mitcherlich equation, and it is often used in chemical engineering. For example, \(y\) may be yield...
Study smarter with the SolutionInn App