sqliteHow do I rename a column in SQLite?
To rename a column in SQLite, you use the ALTER TABLE
command. The syntax for this command is ALTER TABLE table_name RENAME COLUMN old_column_name TO new_column_name;
.
For example, if you wanted to rename the column Name
to FullName
in the Employees
table, you would run the following command:
ALTER TABLE Employees RENAME COLUMN Name TO FullName;
This command does not return any output.
The parts of this command are:
ALTER TABLE
: This specifies that you are altering the table structure.Employees
: This is the name of the table you are altering.RENAME COLUMN
: This specifies that you are renaming a column.Name
: This is the old column name.TO
: This keyword indicates that you are changing the column name.FullName
: This is the new column name.
Helpful links
More of Sqlite
- How do I use the SQLite ZIP VFS to compress a database?
- How can I use Maven to connect to an SQLite database using JDBC?
- How do I extract the year from a datetime value in SQLite?
- How do I set up an ODBC driver to connect to an SQLite database?
- How to configure SQLite with XAMPP on Windows?
- How can I use SQLite with Xamarin and C# to develop an Android app?
- How can I use SQLite window functions in my software development project?
- How do I use SQLite with Visual Studio?
- How can I use a SQLite viewer on Windows?
- How do I use SQLite UNION to combine multiple SELECT queries?
See more codes...