Summary. Use the ALTER TABLE statement to modify the structure of an existing table. Use ALTER TABLE table_name RENAME TO new_name statement to rename a table. Use ALTER TABLE table_name ADD COLUMN column_definition statement to add a column to a table.
It is not possible to rename a column, remove a column, or add or remove constraints from a table. The sqlite file format is very simple and that's why this operation is valid.
Running The Alter Command Click the SQL tab at the top. In the text box, enter the following command: ALTER TABLE exampletable RENAME TO new_table_name; Replace exampletable with your table's name and replace new_table_name with the new name for your table.
ALTER TABLE `foo` RENAME TO `bar`
SQLite Query Language: ALTER TABLE
The answer remains to use "ALTER TABLE". But the main documentation page on this topic is pretty thick. What is needed is a simple example of how that works. You can find that here: https://www.sqlitetutorial.net/sqlite-alter-table/
To be precise, in the most basic case it looks like this:
ALTER TABLE existing_table
RENAME TO new_table;
I am not sure if the dot notation works, but I assume that the following is also correct:
ALTER TABLE existing_database.existing_table
RENAME TO new_database.new_table;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With