ALTER COLUMN

SQL ALTER COLUMN Keyword

ALTER COLUMN

The ALTER COLUMN command is used to change the data type of a column in a table.

Note: SQLite (used in our playground) does not support the ALTER COLUMN syntax directly. To change a column’s data type, you must recreate the table.

Tutorials dojo strip

SQL ALTER COLUMN Syntax (Not supported in SQLite)

SQL

SQL ALTER Example (Not supported in our playground)

The following SQL changes the data type of the column named BirthDate in the Employees table to type YEAR:

SQL

Alternative Method

To change a column’s data type in SQLite, use the following approach:

SQL

This method allows you to effectively alter a column’s data type in our playground environment using SQLite-compatible SQL.

SQL ALTER COLUMN Labs

Tutorials dojo strip