MySql Database- Create/Drop/View

Create Database

Syntax For Creating Database Use Create Database Command

CREATE DATABASE Database Name
CREATE DATABASE  `shiksha360` ;

Select Database

Syntax For Select Database Use USE Command

USE Database Name
USE `shiksha360` ;

Display Database

The SHOW DATABASE statement displays all databases in the MySQL database server. You can use the SHOW DATABASE statement to check the database that you’ve created or to see all the databases on the database server before you create a new database, for example:

USE Database Name
show databases ;
Removing Databases

Removing database means you delete the database physically. All the data and related objects inside the database are permanently deleted and this cannot be undone, therefore it is very important to execute this query with extra cautions.

To delete a database, you use the DROP DATABASE statement as follows:

DROP DATABASE [IF EXISTS] database_name;
DROP DATABASE [IF EXISTS] shiksha360;

Admin has written 171 articles