> For the complete documentation index, see [llms.txt](https://docs.chartsql.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chartsql.com/chartsql-studio/creating-charts/column-data-types.md).

# 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);
```
