Changes between Version 1 and Version 2 of AdvancedReports


Ignore:
Timestamp:
01/10/23 23:57:19 (23 months ago)
Author:
201100
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedReports

    v1 v2  
    11= Напредни извештаи од базата (SQL и складирани процедури)
    22
     3== Извештај за турнири, информации за кои решавачи учествувале на тие турнири, кои квизови ги решавале, колку поени освоиле, како и кој медали ги освоиле
     4
     5
     6{{{
     7select   us.userID,
     8         us.username,
     9         t.tournamentname,
     10         q.quizname,
     11         rt.points,
     12         a.attemptdate,
     13         m.medalname 
     14
     15from quizTaker_participates_in_tournament as qtou
     16
     17left join quiztaker as qt
     18on qtou.userID=qt.userID
     19left join tournament t
     20on qtou.tournamentid = t.tournamentid
     21left join user_table  as us
     22on qt.userID=us.userID
     23left join attempt a 
     24on us.userid = a.userid
     25left join result_table rt
     26on rt.attemptid = a.attemptid
     27left join quiz q
     28on a.quizid = q.quizid
     29join quiz_is_part_of_tournament qipot
     30on q.quizid = qipot.quizid and t.tournamentid = qipot.tournamentid
     31left join medal_is_awarded_to_quiztaker miatq
     32on qt.userid = miatq.userid
     33left join medal m
     34on m.medalid = miatq.medalid and m.tournamentid = qtou.tournamentid
     35order by rt.points
     36}}}
     37
     38== Вкупен број на организирани турнири, играчи и медали
     39
     40
     41{{{
     42select   tou.tournamentname as t_name,
     43         count(distinct qtpt.userid) as total_players,
     44         count(distinct qipot.quizid) as total_quizzes,
     45         count(distinct m.medalid) as total_medals
     46         
     47from tournament tou
     48
     49left join quizTaker_participates_in_tournament qtpt
     50on tou.tournamentid=qtpt.tournamentid
     51left join quiz_is_part_of_tournament qipot
     52on qipot.tournamentid = tou.tournamentid
     53left join attempt a
     54on a.quizid = qipot.quizid
     55left join result_table rt
     56on rt.attemptid = a.attemptid
     57left join medal m
     58on m.tournamentid = tou.tournamentid
     59group by 1
     60order by t_name
     61
     62}}}
     63
     64
     65
     66