From 64981c0453471c9cfc6704b634b07e52aa9a94b6 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 6 Dec 2025 18:10:51 +0100 Subject: [PATCH 1/2] Update create-table.md --- .../sql-statements/data-definition/create/create-table.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/reference/sql-statements/data-definition/create/create-table.md b/server/reference/sql-statements/data-definition/create/create-table.md index 02ab57c14..7199f7770 100644 --- a/server/reference/sql-statements/data-definition/create/create-table.md +++ b/server/reference/sql-statements/data-definition/create/create-table.md @@ -150,7 +150,7 @@ CREATE TABLE test (a INT NOT NULL, b CHAR(10)) ENGINE=MyISAM SELECT 5 AS b, c, d FROM another_table; ``` -Remember that the query just returns data. If you want to use the same indexes, or the same columns attributes (`[NOT] NULL`, `DEFAULT`, `AUTO_INCREMENT`) in the new table, you need to specify them manually. Types and sizes are not automatically preserved if no data returned by the `SELECT` requires the full size, and `VARCHAR` could be converted into `CHAR`. The [CAST()](../../../sql-functions/string-functions/cast.md) function can be used to forcee the new table to use certain types. +Remember that the query just returns data. If you want to use the same indexes, or the same columns attributes (`[NOT] NULL`, `DEFAULT`, `AUTO_INCREMENT`, `CHECK` constraints) in the new table, you need to specify them manually. Types and sizes are not automatically preserved if no data returned by the `SELECT` requires the full size, and `VARCHAR` could be converted into `CHAR`. The [CAST()](../../../sql-functions/string-functions/cast.md) function can be used to forcee the new table to use certain types. Aliases (`AS`) are taken into account, and they should always be used when you `SELECT` an expression (function, arithmetical operation, etc). From e90d68ed46a47349438e138b02e683f52323dcdb Mon Sep 17 00:00:00 2001 From: Stefan Hinz Date: Tue, 9 Dec 2025 22:59:47 +0100 Subject: [PATCH 2/2] Fix typo in create table documentation Corrected a typo in the explanation about the CAST() function. --- .../sql-statements/data-definition/create/create-table.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/reference/sql-statements/data-definition/create/create-table.md b/server/reference/sql-statements/data-definition/create/create-table.md index 7199f7770..3af4e1c8d 100644 --- a/server/reference/sql-statements/data-definition/create/create-table.md +++ b/server/reference/sql-statements/data-definition/create/create-table.md @@ -150,7 +150,7 @@ CREATE TABLE test (a INT NOT NULL, b CHAR(10)) ENGINE=MyISAM SELECT 5 AS b, c, d FROM another_table; ``` -Remember that the query just returns data. If you want to use the same indexes, or the same columns attributes (`[NOT] NULL`, `DEFAULT`, `AUTO_INCREMENT`, `CHECK` constraints) in the new table, you need to specify them manually. Types and sizes are not automatically preserved if no data returned by the `SELECT` requires the full size, and `VARCHAR` could be converted into `CHAR`. The [CAST()](../../../sql-functions/string-functions/cast.md) function can be used to forcee the new table to use certain types. +Remember that the query just returns data. If you want to use the same indexes, or the same columns attributes (`[NOT] NULL`, `DEFAULT`, `AUTO_INCREMENT`, `CHECK` constraints) in the new table, you need to specify them manually. Types and sizes are not automatically preserved if no data returned by the `SELECT` requires the full size, and `VARCHAR` could be converted into `CHAR`. The [CAST()](../../../sql-functions/string-functions/cast.md) function can be used to force the new table to use certain types. Aliases (`AS`) are taken into account, and they should always be used when you `SELECT` an expression (function, arithmetical operation, etc).