Database / Google Spanner Database Interview questions
List the data types supported by Google Spanner?
Spanner's GoogleSQL dialect supports a standard set of scalar and structured types for schema design:
- BOOL - true/false values.
- INT64 - 64-bit signed integers.
- FLOAT64 / FLOAT32 - floating point numbers.
- NUMERIC - high-precision decimal, suited to financial data.
- STRING and BYTES - variable-length text and binary data.
- DATE and TIMESTAMP - calendar dates and UTC instants, the latter used for commit timestamps.
- JSON - semi-structured document storage.
- ARRAY - an ordered collection of any of the above (except another array).
Choosing the right type matters for both storage cost and index behavior; for example, NUMERIC avoids the rounding issues FLOAT64 would introduce in monetary columns.
More Related questions...