General Note: Here we have pulled in the data from a sample database. You can download it from the following link and use it for practicing Click Here For Sample Database
In this tutorial, you will learn the use of ALTER keyword in SQLite.You can modify the table using the ALTER keyword. SQLite ALTER keyword has limited features only. You can add column to existing table but you can not drop the column or modify columns in SQLite like other databases.
alter table table_name add column column_name datatype;
Here we are going to add a active column in the employee table, to find out whether the employee is active or not by assigning 0 or 1 .
alter table employee add column active int;
You can add column with default values also using the below syntax
alter table table_name add column column_name datatype default value;
Can able to add only one column, Not n number of columns in alter statement.
SQLite supports a limited subset of ALTER TABLE. The ALTER TABLE command in SQLite allows the user to rename a table or to add a new column to an existing table. It is not possible to rename a column, remove a column, or add or remove constraints from a table.