create view if not exists event_view_1 as
select
e.nr,
e.timestamp as timestamp,
e.note as eventnote,
(select sum(score) from passe as p where p.event = e.nr) as sum_score,
(select count(nr) from passe as p where p.event = e.nr) as count_passe,
(select sum(arrow) from passe as p where p.event = e.nr) as sum_arrow
from event e