Baselight
WITH cristiano_ronaldo_match_player_stats as 
(SELECT p.name as player, t.name as team, s.season_label as season, c.name as competition, m.date as match_date, home_teams.name as home_team, away_teams.name as away_team, mps.*
FROM @blt.ultimate_soccer_dataset.match_player_stats mps
     INNER JOIN @blt.ultimate_soccer_dataset.matches m on (mps.match_id = m.match_id)
     INNER JOIN @blt.ultimate_soccer_dataset.players p on (mps.player_id = p.player_id)
     INNER JOIN @blt.ultimate_soccer_dataset.teams t on (mps.team_id = t.team_id)
     INNER JOIN @blt.ultimate_soccer_dataset.seasons s on (m.season_id = s.season_id)
     INNER JOIN @blt.ultimate_soccer_dataset.competitions c on (s.competition_id = c.competition_id)
     INNER JOIN @blt.ultimate_soccer_dataset.teams home_teams ON (m.home_team_id = home_teams.team_id)
     INNER JOIN @blt.ultimate_soccer_dataset.teams away_teams ON (m.away_team_id = away_teams.team_id)
WHERE p.player_id = '5b578ccf-496a-5afb-bea2-c7ece1b2c05b' -- Cristiano Ronaldo 
      and year(m.date) >= 2020
)
SELECT
  COUNT(*) AS total_matches,
  COUNT(*) FILTER (WHERE goals_scored > 0) AS matches_with_goals,
  ROUND(
    COUNT(*) FILTER (WHERE goals_scored > 0)::DECIMAL / COUNT(*)::DECIMAL,
    3
  ) AS prob_goal
FROM cristiano_ronaldo_match_player_stats
WHERE minutes_played > 0
total_matchesmatches_with_goalsprob_goal
2371260.532

Share link

Anyone who has the link will be able to view this.