ALTER Table statement:
ALTER TABLE
Sql-statement:: = ALTER TABLE [database-name.] Table-name Alteration
Alteration:: = RENAME to New-table-name
Alteration:: = ADD [COLUMN] Column-def
The RENAME to syntax is used to rename the table name [Database-name.] Table-name to New-table-name. This command cannot be used to move tables between attached databases, and tables can only be renamed in the same database.
The add [COLUMN] syntax is used to add a new field to an existing table. The new field is always added to the end of the existing field list. Column-def can be any form that is allowed in create table and is subject to the following restrictions:
A field cannot have a primary key or a unique constraint.
Fields cannot have these default values: Current_time, current_date, or Current_timestamp
If a NOT NULL constraint is defined, the field must have a non-empty default value.
The SQLite version of the ALTER TABLE command allows the user to rename or add new fields to existing tables, cannot remove fields from the table, and can only add columns at the end of the table
The ALTER table statement's execution time is independent of the amount of data in the table, which is the same as when you operate a table with 10 million rows, and when you manipulate a table with only one row.