Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MongoDB Questions 1. Find out the players with max era and min era per year 2. F

ID: 3571648 • Letter: M

Question

MongoDB Questions

1. Find out the players with max era and min era per year

2. Find out the average, maximun and minimum h and er per team_id

3. Find out the average, maximun and minimum h and er per team_id and year

4. Order the team_id by the number of players in the team and group by year

Here's an example of the data.

player id,yea stint team d,league id, w,l,g, gs,cg, sho, ipouts, h r ,h so, baopp, era,ibb, wp, hbp, k,bfp,gf. r, sh, sf, idp bechtge01, 1871,1, PH1 1,2,3,3,2,0, 0,78.0,43, 23,0, 11,1, 7.96 42 bra 1,WS3, 12,15,30,30,30,0 0,792. 0,361,132 4,37,13 4.5 ,0, 292 fergubo01, 1871,1,NY2, 0,0,1,0,0,0,0, 3.0,8, 3,0,0,0, 27.0 ,0,,,9, fishech01 1871,1 RC1 24,22,1,0,639.0, 295, 103, 3, 4.35 16,24,24, ,0, 257 fleet 1871,1, 0,1,1,1,1 20 0,0,3,0 10.0 21 flowed i01 1871,1, TRO 0,0,1,0,0,0,0, 3.0, 1,0,0,0,0 0.0 mackde01,1871, 1,RC1 0,1,3,1,1,0,0, 39.0, 20, 5,0,3,1 3.46 3.0, 30 mathebo01 1871,1 FW1 6,11,19 9,19,1,0, 507.0,261,9 7,5, 21 17 5.17 243 mcbridi01 1871,1, PH1 18 113, 3, 0, 15 4.58 223 mcmuljo01 1871,1, TRO 12,15,29, 29,28,0,0,747.0,430, 5.53 362 01 1871,1, PH1 0,0,1,0,0,0,0, 3.0, 1,1,0, 2,0 9.0 1, paborch01. 0,2,7,1,1 0,0,88 .0 50, 22,4, 6.75 53 4,6,0 pink 1,0,3,0,0,0,1, 31 0,10,4 0,3,0 3.48

Explanation / Answer

1)SELECT player_id from PLAYERS where era in (select MAX(era) from PLAYERS group by year);

SELECT player_id from PLAYERS where era in (select MIN(era) from PLAYERS group by year);

2)SELECT AVG(h),MAx(h),MIN(h),AVG(hr),MAX(hr),MIN(hr) from PLAYERS GROUP BY team_id;

3)SELECT AVG(h),MAx(h),MIN(h),AVG(hr),MAX(hr),MIN(hr) from PLAYERS GROUP BY team_id and year;

4)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote