Snowflake Data Types
Snowflake · Data Types & SQL Fundamentals
Theory
Every Snowflake column has a data type from a few families. Numeric types include NUMBER(p, s), where INT and INTEGER are synonyms for NUMBER(38,0), and FLOAT for approximate values. String types are VARCHAR (STRING and TEXT are synonyms) and BINARY. Date and time types are DATE, TIME and three timestamps: TIMESTAMP_NTZ (no time zone), TIMESTAMP_LTZ (stored in UTC, shown in the session time zone) and TIMESTAMP_TZ (keeps an offset). Semi-structured types are VARIANT, OBJECT and ARRAY. Others include BOOLEAN, GEOGRAPHY, GEOMETRY and VECTOR.
For example, money belongs in NUMBER(12,2), not FLOAT, because FLOAT can introduce rounding errors.
Why we use it
The data type decides which functions, comparisons and sort order apply, and how exact the stored values are. Picking the right type avoids rounding errors, failed casts and confusing time zone bugs.
When to use it
Use NUMBER with a scale for money and exact counts, FLOAT for scientific measurements, VARCHAR without a length unless you want one enforced, an explicit timestamp type for event times, and VARIANT for raw JSON you will parse later.
Numeric & String Types
NUMBER(precision, scale) is the general-purpose numeric type (FLOAT exists but loses exact precision); VARCHAR and TEXT are equivalent. With no length a VARCHAR defaults to 16,777,216 characters and can be declared up to 128 MB, and the declared length has no performance cost.
Date & Time Types
DATE, TIME, and TIMESTAMP (in three timezone variants — NTZ, LTZ, TZ) cover temporal data; TIMESTAMP_NTZ is the most common default since it stores a wall-clock value with no timezone conversion surprises.
Semi-Structured & Special Types
VARIANT holds any JSON-like value, OBJECT and ARRAY are its structured cousins, and BOOLEAN, BINARY, and GEOGRAPHY round out the less-common types for flags, raw bytes, and geospatial data.
How it works
- Designing a column
- Is it semi-structured data like JSON? Yes: Use VARIANT (or OBJECT/ARRAY). No: Pick a structured type.
- Is it an exact amount or count? Yes: Use NUMBER(p, s). No: Consider FLOAT, VARCHAR, DATE or BOOLEAN.
- Is it a point in time across time zones? Yes: Use TIMESTAMP_TZ or TIMESTAMP_LTZ. No: Use TIMESTAMP_NTZ or DATE.
- Cast explicitly with :: when loading or comparing
Example
SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'EMPLOYEES';Key points
- INT is NUMBER(38,0); use NUMBER with a scale for money, not FLOAT
- VARCHAR length does not affect storage or performance
- Plain TIMESTAMP maps to TIMESTAMP_NTZ by default (TIMESTAMP_TYPE_MAPPING)
- VARIANT holds JSON, Avro, Parquet and similar data in one column
- Use TRY_CAST or TRY_TO_ functions to avoid errors on bad values