Rename in DBMS

Rename

On this page, we will discuss about Rename in DBMS.It is one of the DDL(data definition language) commands.It is used to change the name of the existing table.

Outer Join in SQL

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.

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

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.

Prime Course Trailer

Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription