---
title: "data type"
description: "In the context of databases and programming, a data type defines the nature of data that can be stored in a specific field or variable."
canonical: "https://motherduck.com/glossary/data-type/"
related:
  - title: "Enum data type | MotherDuck Docs"
    url: "https://motherduck.com/docs/sql-reference/duckdb-sql-reference/enum/"
  - title: "Getting Started with DuckLake: A New Table Format for Your Lakehouse"
    url: "https://motherduck.com/blog/getting-started-ducklake-table-format/"
  - title: "Data types | MotherDuck Docs"
    url: "https://motherduck.com/docs/sql-reference/duckdb-sql-reference/data-types/"
---

# data type

> In the context of databases and programming, a data type defines the nature of data that can be stored in a specific field or variable.

In the context of databases and programming, a data type defines the nature of data that can be stored in a specific field or variable. It determines what kind of values are allowed and what operations can be performed on that data. Common data types include integers for whole numbers, floating-point numbers for decimals, strings for text, and booleans for true/false values. More complex data types like dates, times, and arrays are also widely used.

In [DuckDB](https://duckdb.org/), you can work with a variety of data types. For example, you might define a table with different data types like this:

<glossary-callout guide="duckdb-cheatsheet-full" />

```sql
CREATE TABLE employees (
    id INTEGER,
    name VARCHAR,
    salary DECIMAL(10,2),
    hire_date DATE,
    is_active BOOLEAN
);
```

Here, `INTEGER` is used for whole numbers, `VARCHAR` for text, `DECIMAL` for precise decimal numbers, `DATE` for calendar dates, and `BOOLEAN` for true/false values.

Understanding data types is crucial for data analysts and engineers as it affects how data is stored, processed, and queried efficiently. It also helps in maintaining data integrity and performing accurate calculations.
