# Column Data Types

## ChartSQL and SQL Data Types

ChartSQL detects the columns and data types of your SQL queries to determine how to visualize your query. ChartSQL has 4 data types:

* Date
* Datetime
* String
* Numeric

## SQL Data Type Mapping

Every supported SQL database column type is mapped to one of the ChartSQL datatypes automatically. For example, MySQL int, double, and bigint are mapped to `numeric` while MySQL date is mapped to `date`&#x20;

## Manual CAST

If your SQL query returns values that you want ChartSQL to detect as a different type, you need to CAST your value in SQL to the appropriate type.&#x20;

See CAST notes about your particular [datasource](/chartsql-studio/datasources/datasources.md)

Example casting a string in MySQL to a date:

```sql
SELECT CAST('2021-01-01' AS DATE);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chartsql.com/chartsql-studio/creating-charts/column-data-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
