Rename in DBMS

Rename in DBMS

 

In this article, we will learn about Rename in DBMS.

Sometimes the user wants to permanently delete the existing table or wants to delete the existing data alone or change the table name all these purposes are served using 3 DDL(data definition language) commands drop, truncate and rename respectively

Rename in DBMS

Renaming a table: RENAME COMMAND

The rename command is used to change the existing table name and give a new name to the table.

Syntax

rename old_table _name to new_table_name

Example

rename emp to Employees

O/P

Table emp  renamed successfully

The above query changes the emp table name from emp to employees all operations on the table must be done using the new name employees otherwise it will raise an error.