reset password
Author Message
cysun
Posts: 2935
Posted 10:24 May 15, 2011 |

I got some questions about the grading of Lab 3 Part II, particularly query #7 and #8, so here are some clarifications.

The total for Part II is 25pt, where 5pt are for the INSERT statements, and the queries are worth 2pt each.

Query #7 asks for the average rating of cysun's answers. Note that the rating of an answer is the sum of votes for the answer. For example, suppose cysun has given two answers. One of the answers received two +1 votes, and the other one received one +1 vote, so the rating for the first answer is 2 and the rating for the second one is 1, and the average rating of cysun's answers is 1.5.

Most people used avg(votes.value) for Q7, which is the average vote value (which would be 1 in the example above), not the average rating. The correct answer requires a subquery where the subquery performs a "sum(votes.value) group by answer", then the main query calculates the average.

Because Q8 also asks for average rating, if you got Q7 wrong, your Q8 solution would be wrong too so you won't get any extra credit (and nobody did); however, you don't lose any point for Q8 either.