October 2019
Intermediate to advanced
519 pages
13h 39m
English
In the bike rental queries in the previous chapters, when we divided the trip duration by 60, we were able to do so because trip duration was a numeric type. Trying to divide the gender by 60 would not have worked because gender is a string. The functions and operations you have at your disposal might be restricted based on the type of data to which you are applying them.
BigQuery supports several data types to store numeric, string, time, geographic, structured, and semi-structured data:
INT64FLOAT64, and for Booleans, use BOOL.NUMERICNUMERIC offers 38 digits of precision and 9 decimal digits of scale and is suitable for exact calculations, such as in finance.STRINGBYTES are variable-length sequences of characters (not Unicode).TIMESTAMPDATETIMEDATE and TIME are also available separately.GEOGRAPHYGEOGRAPHY represents points, lines, and polygons on the surface of the Earth.STRUCT and ARRAYAs just stated, there is only one integer type (INT64) and only one floating-point type (FLOAT64). Both of these types support the typical arithmetic operations ...
Read now
Unlock full access