79083596

Date: 2024-10-13 16:20:43
Score: 1.5
Natty:
Report link

PostgreSQL:

select 
    id,
    (SUM(score) - MAX(score) - MIN(score)) / (COUNT(score) - 2) AS avg_score
from (select 
        id, 
        UNNEST(array[score1, score2, score3, score4, score5, score6, score7]) AS score
     from score_table) AS scores_per_row
group by id
order by id;

Output:

enter image description here

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: sarwar