Google BigQuery uses a collection of data types that allow it to store and handle data in the most effective way. Understanding these types is crucial to manipulating, analyzing, and visualizing your data effectively. Here are the main categories of data types in BigQuery:

Numeric Data Types #

  1. INT64 (Integer): This data type is used to store whole numbers, both positive and negative.

  2. FLOAT64 (Floating-point number): Used for storing real numbers, including numbers with fractional components.

  3. NUMERIC: A precise numeric data type that supports up to 38 digits of precision, suitable for financial and monetary calculations.

  4. BIGNUMERIC: Similar to NUMERIC, but with even larger precision and scale.

  5. BOOL (Boolean): Used for storing true/false values.

Temporal Data Types #

  1. DATE: Stores the date information, formatted as YYYY-[M]M-[D]D.

  2. DATETIME: A combination of date and time, without timezone information.

  3. TIME: Stores time information, without the date.

  4. TIMESTAMP: Stores a specific point in time, with microsecond precision and timezone information.

String and Binary Data Types #

  1. STRING: This data type stores sequences of characters.

  2. BYTES: Similar to STRING, but stores sequences of bytes.

Structured Data Types #

  1. ARRAY: This type stores an ordered list of zero or more elements of a specified data type.

  2. STRUCT (Record): Used to define complex data types composed of multiple fields.

Geographical Data Types #

  1. GEOGRAPHY: Utilized for geospatial data, which represents points, lines, and polygons on the Earth's surface.

To manipulate these data types effectively in BigQuery, it's crucial to understand their properties, such as precision, size, and format. This knowledge will help you choose the correct type for a particular column based on the kind of data you want to store, thereby increasing your data handling efficiency and reducing the chances of errors.

Read previous:

Functions in Python