I wrote the query below to calculate the death percentage in Postgresql and the result is zero,but same query in Bigquery gets the correct result. Can anyone have idea? Thanks!
SELECT
location,
MAX(total_cases) AS Cases_total,
MAX(total_deaths) AS Death_total, (MAX(total_deaths)/MAX(total_cases))*100 AS DeathPercentange
FROM covid_deaths
WHERE continent IS NOT NULL
GROUP BY location
ORDER BY DeathPercentange DESC;
I am not allowed to insert my screenshot so I have the link:
The database looks like this: The preview of the database