# Data Types

Common data types in MySQL:

| Data Types | Usage                        |
| ---------- | ---------------------------- |
| INT        | integers                     |
| DOUBLE     | decimals                     |
| VARCHAR    | string (less than 255 chars) |
| TEXT       | string (more than 255 chars) |
| DATETIME   | date and time                |
| DATE       | date only                    |

In MySQL, `DATETIME` and `DATE` must be quoted using single quotes or double quotes. The format must be `YYYY-MM-DD` and `HH:MM:SS`. For example, we create a new table `t_datetime`:

```sql
CREATE TABLE t_datetime (a DATE);
```

Insert a date:

```sql
INSERT INTO t_datetime (a) VALUES('2022-02-22 22:22:22');
```


---

# 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://ret2basic.gitbook.io/ctfnote/computer-science/databases/mysql/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.
