Data and Business Intelligence Glossary Terms

What is a data type?

A data type is a field’s classification as implemented directly by a database. Data types tell the database what kind of values to expect in a column — integers, strings, timestamps — and it enforces that rule on every row written.

Types are declared when you define a table, as part of its schema:

CREATE TABLE orders (
  id          BIGINT PRIMARY KEY,
  customer_id BIGINT NOT NULL,
  subtotal    NUMERIC(10, 2) NOT NULL,
  status      VARCHAR(20),
  is_gift     BOOLEAN DEFAULT false,
  created_at  TIMESTAMPTZ NOT NULL
);

Common SQL data types

Exact names vary between database engines, but the families are the same everywhere:

  • IntegersSMALLINT, INTEGER, BIGINT. Whole numbers, used for counts and IDs.
  • Exact decimalsNUMERIC or DECIMAL, with a declared precision and scale. Use these for money.
  • Floating pointREAL, DOUBLE PRECISION. Fast and approximate; 0.1 + 0.2 won’t be exactly 0.3, which is why they’re a bad choice for currency.
  • TextCHAR (fixed length), VARCHAR (bounded), TEXT (unbounded).
  • Booleantrue / false, and in SQL also NULL.
  • Dates and timesDATE, TIME, TIMESTAMP, and TIMESTAMPTZ, which carries a time zone. Store timestamps in UTC and convert at query time.
  • Semi-structuredJSON or JSONB for nested payloads, plus arrays in engines that support them. See JSON for the trade-offs.
  • Identifiers and other specialsUUID, INET, geometry types, and enums, depending on the engine.

Why type matters for analytics

Type decides what you’re allowed to do with a value:

  • Aggregation. You can SUM a number. You can’t SUM text, so a revenue column stored as VARCHAR blocks the exact question you bought a warehouse to answer.
  • Sorting. Numbers stored as text sort alphabetically, which puts 100 before 2.
  • Time grouping. A date stored as a string can’t be truncated to a month or filtered to “last 30 days” without casting it first.
  • Joins. A foreign key whose type doesn’t match the primary key it points at can fail to match or quietly kill performance.
  • Precision. Floating-point money drifts by fractions of a cent, and those fractions turn into reconciliation work later.

Data usually arrives untyped. Spreadsheet exports and API responses hand you strings for everything, so casting to the right type belongs in the transform step of your ETL pipeline, not in every downstream query.

Data types vs. field types

A data type is what the database enforces. A field type is a layer of metadata on top of it describing what a column means — that a VARCHAR holds an email address, or that a NUMERIC is currency. Two columns can share a data type and behave very differently in a report because their field types differ.

Was this helpful?

Thanks for your feedback!