You have to use a GROUP BY
clause on the proper field to get the average for each group, otherwise it will calculate the average of all rows. I guess it's games.id
, but depends on your table schemata.
SELECT games.name, CAST(AVG(reviews.rating) as decimal(6, 1)) AS average_rating
FROM games
JOIN reviews
ON games.id = reviews.game
WHERE games.name LIKE '%spider%'
AND type = '7'
AND rating != 0
GROUP BY games.id;
Read more about so called aggregate functions