SQL RENAME TABLE
Sometimes you need to rename a table to give it a more appropriate name. SQL provides the RENAME TABLE and ALTER TABLE statements to do this easily.
Complete Python Course with Advance topics:-
SQL Tutorial:-
Method 1: RENAME Statement
RENAME old_table_name TO new_table_name;
-- Example
RENAME Vehicles TO Vehicle_Inventory_2025;
Method 2: ALTER TABLE Statement
ALTER TABLE old_table_name RENAME TO new_table_name;
-- Example
ALTER TABLE Products RENAME TO Product_Inventory;
Syntax Across Databases
-- MySQL
RENAME TABLE Students TO Student_Records;
-- SQL Server (uses stored procedure)
EXEC sp_rename 'Students', 'Student_Records';
-- PostgreSQL / Oracle
ALTER TABLE Students RENAME TO Student_Records;
Things to Remember
- Renaming may break views, stored procedures, or app code referencing the old name.
- Ensure the new name does not already exist.
- You need appropriate privileges to rename a table.
Download New Real Time Projects:- Click here
Complete Advance AI topics:-
Conclusion
Renaming tables keeps your database clear and intuitive. Use RENAME TABLE or ALTER TABLE ... RENAME TO depending on your database. For more SQL tutorials, visit .
mysql rename table
rename table name in sql w3schools
sql rename table postgres
oracle sql rename table
alter table rename
sp_rename sql server
sql rename table example
sql rename table name