Comments - CREATE TABLE

7 months ago Siavosh Kasravi

If I want to make a column nullable, why should I know the column's data type and put it in ALTER command string?

 
7 months ago Sergei Golubchik

SQL Standard has syntax

ALTER TABLE table_name ALTER column_name DROP NOT NULL

but MariaDB doesn't support it yet

 
7 months ago Alexander Keremidarski

When you CREATE TABLE you must know the column type. When you ALTER TABLE you can set certain properties with ALTER COLUMN without knowing the column type. Not that it is good idea to use any DDL statement without knowing what columns you have, but that's another topic.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.