how to Create, drop and rename of mysql database
How To Create DATABASE
The SQL CREATE DATABASE statement is used by a developer to create a database.
Let’s see the Example of CREATE SQL DATABASE:
CREATE DATABASE DataBaseName;
How To Drop DATABASE
SQL DROP statement is used By Developers to delete or remove the database.
If you want to delete or drop an existing database in a SQL than you can use SQL DROP DATABASE statement.
Let’s see the example of SQL DROP DATABASE:
DROP DATABASE DataBaseName;
If you delete or drop the database, all the tables and views will also be deleted. So be careful while drop Your SQL database.
How To Rename DATABASE
Sometimes you need to change the name of your database because of the original name was not more relevant to the data. Or, you just want to give a temporary name to that data for easy to remember.
SQL RENAME DATABASE statement is used to change the name of a database.
Let’s see the example of SQL Rename DATABASE:
RENAME DATABASE old_db_name TO new_db_name;
You Can Also use following command to change name of your database.
ALTER DATABASE old_name MODIFY NAME = new_name