Fares and ages

extensional passenger(id: integer, survived: integer, class: integer, sex: string, fare: float).

fare_by_class(Class, avg(Fare)) :-
    passenger(_, _, Class, _, Fare).
classavg fare
184.15
220.66
313.68
age_by_survival(Survived, avg(Years), count(_)) :-
    passenger(Id, Survived, _, _, _), age(Id, Years).
survivedavg agecount
030.6424
128.3290

424 + 290 = 714 < 891: not all ages are known.