I am in the Google Data analytics course, and in this particular lesson we were instructed to download some data about avocados from Kaggle, upload it into sample bigquery, and do some BASIC addition using query commands. I seem to be encountering a cascade of issues that I’m not able to circumvent, including:
- Bigquery not recognizing the columns im trying to call in the select statement
- Not recognizing the addition operator
- It keeps expecting the statement to have ended even though I’m including a bunch of commas.
The issues go as follows: I enter/copy/paste this into bigquery:
SELECT
Date,
Region,
Small_Bags,
Large_Bags,
XLarge_Bags,
Total_Bags,
Small_Bags + Large_Bags + XLarge_Bags AS Total_Bags_Calc
FROM your-project.avocado_data.avocado_prices
When this data is entered, the following error is returned:
“Unrecognized name: Small_Bags; Did you mean Small Bags? at [4:9]”
**
Fine. After removing the underscores, the code looks as follows:**
SELECT
Date,
Region,
Small Bags,
Large Bags,
XLarge Bags,
Total Bags,
Small Bags + Large Bags + XLarge Bags AS Total_Bags_Calc
FROM sample-bigquery-421913.avocado_data.avocado_prices
but, the following error is returned:
“Syntax error: Expected end of input but got “+” at [8:20]”
After removing the calculation the code looks as follows:
SELECT
Date,
Region,
Small Bags,
Large Bags,
XLarge Bags,
Total Bags,
FROM sample-bigquery-421913.avocado_data.avocado_prices
and returns the following error:
Unrecognized name: Small at [4:9]
**After which it proceeds to tell me that it CANNOT recognize the names of ANY of the columns that I am trying to call inside this query. This is a BASIC mathematical query and i KNOW THAT. but WHY wont it let me do BASIC ADDITION. What am I doing WRONG I’ve been staring at this query for the last two days and I’m tearing my hear out over here. **
Alisha Smith is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.