-- Для каждого спортсмена посчитать число заявок и число серий
create view
    sportsman_requests_series_count as
select
    s.id_sportsman,
    count(distinct pr.id_participant_request) as pr_count,
    count(ss.id_shot_series) as ss_count
from
    sportsman as s
    left join participant_request as pr on s.id_sportsman = pr.id_sportsman
    left join shot_series as ss on pr.id_participant_request = ss.id_participant_request
group by
    s.id_sportsman

    
-- insert into sportsman_requests_series_count (id_sportsman, pr_count, ss_count) values (1, 2, 3)
-- update sportsman_requests_series_count set pr_count = 5, ss_count = 10 where id_sportsman = 201