Data Analyst Portfolio Project | SQL Data Exploration | Project 1/4
Why Stack Overflow recommends it
Stack Overflow users who follow along with this video cite it when their copied SQL (CAST syntax, CTEs, rolling vaccination sums) throws errors on SQL Server or BigQuery.
Recommended by 0 people across 0 different months, 2022 to 2024.
What it is
A 1h17m tutorial from Alex The Analyst, the first of a four-part data analyst portfolio series, walking through SQL data exploration on the Our World in Data COVID deaths and vaccinations tables. It covers casts, aggregates, joins, CTEs, temp tables and views, with the results meant to be visualized in Tableau in the next project.
What people said
Cites JoePegasus · 2022-08 · Stack Overflow · on “Why am I getting an "Incorrect syntax near ')'" error for a CTE query?”
I'm following Alex the Analyst's Portfolio Project for SQL Data Exploration - [this video] - (around the 59min mark) and I'm stuck on the "building a CTE" part: WITH PopvsVac ( Continent, location, date, population, new_vaccinations, RollingPeopleVaccinated ) AS ( SELECT dea.continent, dea.location, dea.date, dea.population, vac.new_vaccinations, SUM(CAST(vac.new_vaccinations AS bigint)) OVER ( PARTITION BY dea.location ORDER BY dea.location, dea.date ROWS UNBOUNDED PRECEDING ) AS RollingPeopleVaccinated FROM PortfolioProject..CovidDeaths AS dea INNER JOIN PortfolioProject..CovidVaccinations AS vac ON dea.location = vac.location AND dea.date = vac.date WHERE dea.continent IS NOT NULL ) I understa
Cites ashi1992 · 2023-01 · Stack Overflow · on “Incorrect syntax near 'cast', expected 'AS'- SQL Project”
I am watching this video from Alex Freburg: [this video] . At 33.43 mins he has done some code on the server, the exact I have copied but I get this error message: Incorrect syntax near 'CAST', expected 'AS' The code I have tried to run is this: Select location, MAX(CAST(total_deaths) AS int)) AS TotalDeathCount From [Portfolio Project]..CovidDeaths$ group by location order by TotalDeathCount desc Any help would be appreciated. I tried a variety of things but not sure why it is not working like the video above.
Cites Will Simotas · 2024-01 · Stack Overflow · on “Why is BigQuery Sandbox saying its ERROR: Expected keyword AS but got "(" at [1:17]”
Is this an issue with BigQuery. I was following along with this [this video] Youtube video and for some reason this code will not work. WITH pop_vs_vac (continent, location, DATE, population, new_vaccinations, rolling_people_vaccinated) AS ( SELECT dea.continent, dea.location, dea.DATE, dea.population, vac.new_vaccinations, SUM(CAST(vac.new_vaccinations AS INT)) OVER (PARTITION BY dea.location ORDER BY dea.location, dea.DATE) AS rolling_people_vaccinated -- (rolling_people_vaccinated/population)* 100 FROM [gg-analytics-404715.Portfolio_Covid.Covid_Deaths] AS dea JOIN [gg-analytics-404715.Portfolio_Covid.Covid_vaccinations] AS vac ON dea.location = vac.location AND dea.DATE = vac.DATE WHERE dea.co