Skip to content
  • SiteMap
  • Our Services
  • Frequently Asked Questions (FAQ)
  • Support
  • About Us

UpdateGadh

Update Your Skills.

  • Home
  • Projects
    •  Blockchain projects
    • Python Project
    • Data Science
    •  Ai projects
    • Machine Learning
    • PHP Project
    • React Projects
    • Java Project
    • SpringBoot
    • JSP Projects
    • Java Script Projects
    • Code Snippet
    • Free Projects
  • Tutorials
    • Ai
    • Machine Learning
    • Advance Python
    • Advance SQL
    • DBMS Tutorial
    • Data Analyst
    • Deep Learning Tutorial
    • Data Science
    • Nodejs Tutorial
  • Blog
  • Contact us
  • Toggle search form
SQL RENAME TABLE

SQL RENAME TABLE: A Complete Guide

Posted on January 12, 2025January 12, 2025 By Rishabh saini No Comments on SQL RENAME TABLE: A Complete Guide

SQL RENAME TABLE

In certain cases, users and database administrators wish to rename a table in a SQL database in order to give it a more appropriate name.

The RENAME TABLE and ALTER TABLE statements in Structured Query Language make it simple for any database user to modify the name.

To change the table’s name, use the RENAME TABLE and ALTER TABLE syntax.

Complete Advance AI topics:- CLICK HERE
Complete Python Course with Advance topics:-Click here

Syntax of RENAME Statement in SQL

RENAME old_table_name TO new_table_name;

Examples of RENAME Statement in SQL

Here, we’ve used two distinct SQL examples to show you how to use the RENAME statement to modify the name of a SQL table in the database:

Example 1: Renaming the Table Vehicles

Consider the table Vehicles:

Vehicle_IDVehicle_NameVehicle_Cost
101Honda City12,00,00
102Hyundai i208,40,000
103Maruti Swift7,50,000
104Kia Seltos15,00,000
105Tata Nexon10,00,000

Suppose you want to rename the above table to Vehicle_Inventory_2025. For this, you need to type the following query:

RENAME Vehicles TO Vehicle_Inventory_2025;

After executing this query, the table Vehicles will be renamed to Vehicle_Inventory_2025.

Example 2: Renaming the Table Staff

Consider the table Staff:

Staff_IDStaff_NameStaff_PositionStaff_Salary
201PriyaManager50,000
202RaviClerk30,000
203AshaAccountant40,000
204RohitSupervisor35,000
205NehaHR Executive45,000

To rename the above table to Employee_Records, use the following query:

RENAME Staff TO Employee_Records;

After this query, the table Staff will be renamed to Employee_Records.

Syntax of ALTER TABLE Statement in SQL

ALTER TABLE old_table_name RENAME TO new_table_name;

In this syntax, we use the RENAME TO keyword after specifying the old table name.

Examples of ALTER TABLE Statement in SQL

Below are three examples to demonstrate how to use the ALTER TABLE statement for renaming a table:

Example 1: Renaming the Table Products

Consider the table Products:

Product_IDProduct_NameProduct_Price
301Laptop60,000
302Smartphone25,000
303Smartwatch10,000
304Tablet15,000
305Headphones5,000

To rename the table to Product_Inventory, use the following query:

ALTER TABLE Products RENAME TO Product_Inventory;

After executing this query, the table Products will be renamed to Product_Inventory.

Example 2: Renaming the Table Students

Consider the table Students:

Student_IDStudent_NameStudent_Grade
401AbhishekA
402SunitaB
403MohitA
404KavyaB+
405AryanA

Suppose you want to rename this table to Student_Records. For this, type the following query:

ALTER TABLE Students RENAME TO Student_Records;

After executing this query, the table Students will be renamed to Student_Records.

Example 3: Renaming the Table Orders

Consider the table Orders:

Order_IDCustomer_NameOrder_Total
501Shreya8,000
502Raj10,000
503Meera7,500
504Karan12,000
505Priyanka9,500

To rename the table Orders to Customer_Orders_2025, use the following query:

ALTER TABLE Orders RENAME TO Customer_Orders_2025;

After this query, the table Orders will now be renamed to Customer_Orders_2025.

Conclusion

Renaming tables in SQL is a simple but essential task that ensures your database is clear and intuitive. Using the RENAME TABLE or ALTER TABLE statements, you can keep your database well-organized and relevant.

For more SQL tips and tutorials, visit UpdateGadh, your trusted source for database management guides.

Download New Real Time Projects :-Click here


mysql rename table
rename table name in sql w3schools
sql rename column
sql rename table postgres
rename table name in sql server using query
oracle sql rename table
alter table rename column
rename column name in sql server
sql server rename table
sql rename table name
sql rename table oracle
sql rename table example

Post Views: 769
SQL Tutorial Tags:change name table sql, change table name in sql, change table name sql, how to rename table in sql, how to rename table sql, learn sql, rename table, rename table in sql, rename table microsoft sql server, rename table microsoft sql server management studio, rename table sql, rename table sql server, rename table sql server management studio, script rename table sql, sql, sql change table name, sql rename table, sql rename table example, sql rename table statement

Post navigation

Previous Post: How to Install Matplotlib in Python
Next Post: File Sharing App With Free Source Code

More Related Articles

SQL DELETE Statement SQL DELETE Statement SQL Tutorial
SQL SELECT DATE SQL SELECT DATE: Retrieving and Filtering Dates Professionally SQL Tutorial
SQL DELETE DUPLICATE ROWS SQL DELETE DUPLICATE ROWS SQL Tutorial

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may also like

  1. Understanding the SQL DELETE Statement and Its Variants
  2. SQL SELECT from Multiple Tables
  3. SQL WITH Clause
  4. SQL UPDATE with JOIN
  5. Understanding SQL CROSS JOIN with Examples
  6. IN vs EXISTS in SQL: A Complete Guide

Most Viewed Posts

  1. Top Large Language Models in 2025
  2. Online Shopping System using PHP, MySQL with Free Source Code
  3. login form in php and mysql , Step-by-Step with Free Source Code
  4. Flipkart Clone using PHP And MYSQL Free Source Code
  5. News Portal Project in PHP and MySql Free Source Code
  6. User Login & Registration System Using PHP and MySQL Free Code
  7. Top 10 Final Year Project Ideas in Python
  8. Blog Site In PHP And MYSQL With Source Code || Best Project
  9. Online Bike Rental Management System Using PHP and MySQL
  10. E learning Website in php with Free source code
  • AI
  • ASP.NET
  • Blockchain
  • ChatCPT
  • code Snippets
  • Collage Projects
  • Data Science Project
  • Data Science Tutorial
  • DBMS Tutorial
  • Deep Learning Tutorial
  • Final Year Projects
  • Free Projects
  • How to
  • html
  • Interview Question
  • Java Notes
  • Java Project
  • Java Script Notes
  • JAVASCRIPT
  • Javascript Project
  • JSP JAVA(J2EE)
  • Machine Learning Project
  • Machine Learning Tutorial
  • MySQL Tutorial
  • Node.js Tutorial
  • PHP Project
  • Portfolio
  • Python
  • Python Interview Question
  • Python Projects
  • PythonFreeProject
  • React Free Project
  • React Projects
  • Spring boot
  • SQL Tutorial
  • TOP 10
  • Uncategorized
  • Agentic RAG AI System Using Python – Complete Final Year Project Guide
  • AI-Powered Online Examination System with Face Detection Using PHP & MySQL
  • Real-Time Medical Queue & Appointment System with Django
  • Online Examination System in PHP with Source Code
  • AI Chatbot for College and Hospital

Most Viewed Posts

  • Top Large Language Models in 2025 (8,632)
  • Online Shopping System using PHP, MySQL with Free Source Code (5,250)
  • login form in php and mysql , Step-by-Step with Free Source Code (4,913)

Copyright © 2026 UpdateGadh.

Powered by PressBook Green WordPress theme