Closed nddrylliog closed 12 years ago
I've started it (see 38beef45dcf49447ad4b7f4faf2ae001827e4434 ), but I'm going to bed for now. After all, the deadline is still far along, and I'm making good progress on these queries.
Finished in 70b1e863c1ff682bca47866fe65825d35472d31e, closing.
It seems it's computing the data (avg and age) from the coaches instead of the team members. Or did I misunderstood the query we have to solve?
"of teams of coaches" -> I thought this meant precisely that it was the average of weight/height etc. of the players in the teams managed by (coaches who had more then XXX/YYY career/wins percentage). Don't you think? We could argue either way imho...
Apparently we agree on that, the SQL query doesn't seem to do that. Since I changed it to use the coaches
table, it might be empty on your side until we find what's going on.
Yeah but still using only the coaches tables how can you find the average weight/height/age of the players of these teams?
I'd use best_coaches.year + best_coaches.team_id
(to add) and join that with player_seasons
. The coaches
table is only useful for the XXX
param which doesn't have to be recomputed.
By "you would" you mean "in the final version of the query which is not yet done", correct?
Indeed. When the average age is above 60, something is wrong :-)
My average age seemed correct btw, (using to_date(year, 'YYYY') instead of SYSDATE) On May 22, 2012 10:07 PM, "Yoan Blanc" < reply@reply.github.com> wrote:
Indeed. When the average age is above 60, something is wrong :-)
Reply to this email directly or view it on GitHub: https://github.com/nddrylliog/cs322/issues/18#issuecomment-5857344
I wanted to work on that some more, but it returns 0 rows, I guess because 'coaches' is empty because of triggers. I'll try debugging them now on my side.
Hypothesis: my user doesn't have the permission to create triggers :D
Aaand that was it. coaches table is correctly populated now. Finishing up this query
Welp, I think something's wrong:
It's giving very good results now :)
Sweet!
The reason why I redid the HTML view:
In query (c) we expect from you to list the asked statistics (avg height, avg weight, avg age) for every season of a coach who in total in his career he had at least XXX wins and YYY win percentage. For example, for a "good coach" who coached for 10 seasons you will have 10 rows in your resultset. — http://moodle.epfl.ch/mod/forum/discuss.php?d=167271#p375511
List the average weight, average height and average age, of teams of coaches with more than XXX season career wins and more than YYY win percentage, in each season they coached. (XXX and YYY are parameters. Try with combinations:
{XXX,YYY}={<1000,70%>,<1000,60%>,<1000,50%>,<700,55%>,<700,45%>}
. Sort the result by year in ascending order.