Examples of MySQL Rename View
Example 1: Renaming view1 using RENAME keyword
Let RENAME view1 to employee_details1.
Syntax:
RENAME TABLE old_view_name TO new_view_name;
Query:
RENAME TABLE view1 TO employee_details1;
Output:
Explanation: In the above example we are renaming view1 to employee_details1. In the output we can see that there are 0 rows affected, this is because renaming a view will not change the underlying data in the table.
Example 2: Renaming view2 using RENAME keyword
Lets RENAME view2 to employee_details2
Syntax:
RENAME TABLE old_view_name TO new_view_name;
Query:
RENAME TABLE view1 TO employee_details1;
Output:
Explanation: In the above example we are renaming view2 to employee_details2. In the output we can see that there are 0 rows affected, this is because renaming a view will not change the underlying data in the table.
MySQL – Rename View
MySQL is a popular open-source relational database management system (RDBMS) that is usually used for developing scalable and high-performance databases. MySQL was developed by MySQL AB (currently owned by Oracle Corporation) in 1995. MySQL is known for its robust, easy, and reliable features with quick processing speeds. MySQL is generally used by dynamic web applications and is commonly used by languages such as PHP, Python, and other server-side programming languages.
In this article, you will learn how to RENAME a view in MySQL along with some examples.