Adult animal weights

Question

Given the following tables, write a SQL query to return the average weight for each adult animal:

table_1

adult animal animal_id size
0 False cat 1 M
1 True dog 2 M
2 False cat 3 M
3 False fish 4 S
4 True dog 5 L
5 True cat 6 M
6 True cat 7 M

table_2

animal_id weight
0 1 8
1 2 10
2 3 11
3 4 1
4 5 20
5 6 12
6 7 12

Solution

Access restricted

Subscribe to premium account to see the solution.

Get premium now