I took a SQL course and am now trying to apply the lessons in practice but I can't seem to find out how to make it work.
I have two tables that contain financial information about basketball teams by year. They share the same data in the year and team columns but have a differing column each, 'team_expenses_in_dollars' and 'operating_income_in_dollars' respectively.
I'm trying to combine these two tables into one using BigQuery using INNER JOIN so that I have just one table with the columns year, team and this above.
I uploaded the separate tables into the same dataset of the same project.
SELECT
team_expenses.player_expenses_in_dollars,
team_operating_income.team_operating_income_in_dollars,
FROM
`player-impacts-on-teams.lebron_impact.team_expenses`
INNER JOIN
`player-impacts-on-teams.lebron_impact.team_operating_income`
ON `player-impacts-on-teams.lebron_impact.team_expenses`.year = `player-impacts-on-teams.lebron_impact.team_operating_income`.year;
I get this error
Unrecognized name: team_expenses at [1:8]
but I have checked and the name of the table and columns are correct.
What part of my code is wrong here? Or am I doing this completely wrong.
Ideally I'm hoping to combine these two tables together into one.