How to use SQLite ALTER TABLE to Rename a Column In SQL
To rename an existing column, we can use the following syntax:
ALTER TABLE table_name RENAME COLUMN old_column TO new_column;
Now, in the above example, we want to change the column named user_id to customer_id. So we use:
ALTER TABLE customers RENAME COLUMN user_id TO customer_id;
Output:
SQLite Alter Table
SQLite is a serverless architecture that we use to develop embedded software for devices like televisions, cameras, and so on. It is written in C programming Language. It allows the programs to run without any configuration. In this article, we will learn everything about the ALTER TABLE command present in SQLite. In SQLite, the ALTER TABLE
statement empowers you to make changes to the structure of an existing table without the need to recreate it entirely.