| 69 | {{{ |
| 70 | select q.quizname, |
| 71 | count(a.attemptid) |
| 72 | from quiz q |
| 73 | join attempt a on q.quizid=a.quizid |
| 74 | where a.attemptdate between now() - interval '2 years' and now() |
| 75 | group by 1 |
| 76 | order by count(a.attemptid) |
| 77 | |
| 78 | }}} |
| 79 | |
| 80 | |
| 81 | == Просечни поени по квиз |
| 82 | |
| 83 | |
| 84 | {{{ |
| 85 | select qt.userid, q.quizname, avg(rt.points) from quiztaker qt |
| 86 | left join attempt a on qt.userid= a.userid |
| 87 | left join quiz q on q.quizid=a.quizid |
| 88 | left join result_table rt on a.attemptid=rt.attemptid |
| 89 | group by 1, 2; |
| 90 | }}} |
| 91 | |
| 92 | |
| 93 | == Вкупен број решени квизови во последните 3 месеци |
| 94 | |
| 95 | |
| 96 | {{{ |
| 97 | select count(qu.quizid) as broj_resheni_kvizovi |
| 98 | from quiz qu |
| 99 | join attempt at on qu.quizid = at.quizid |
| 100 | join quizTaker qt on at.userid = qt.userid |
| 101 | and at.attemptdate between now() - interval '3 months' and now() |
| 102 | }}} |
| 103 | |
| 104 | |