Skip to content

Instantly share code, notes, and snippets.

@mbforr
Created July 6, 2021 19:00
Embed
What would you like to do?
select
# this will create a new column using a function
# this won't be a part of the dataset, just the query itself
# we can calculate the area of the geometry in sq. meters
# then transform that using math to sq. miles
# we can also use a column alias here - as square_miles
# you can call this column anything you want, just change "square_miles"
st_area(state_geom) / 2.59e+6 as square_miles
from
`bigquery-public-data.geo_us_boundaries.states`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment