Create, show, and drop databases are essential in database management. It is the basic of SQL (Structured query language).

Create, show and drop databases


Create, show, and drop databases

To Create, show, and drop databases you can use Xampp software. Follow these steps at first.

  • Open Xampp
  • Click on the start button of apache and MySQL
  • Click on the admin (Right side of MySQL)



Create database, show databases, drop databases



After clicking on the admin of MySQL local host will open.

Create database, show databases, drop databases

Database create

Write SQL command like this.


CREATE DATABASE DATABASE_NAME;

Click on the SQL option and ten SQL command boxes will be open. If you want to create a database whose name is "company" then write a command like this-

CREATE DATABASE company;

Create database, show databases, drop databases



Now click on the go button(right-bottom side). On the left side, you will show that a new database has been created which name is company.

Create database, show databases, drop databases



See on the left side a database named company has created. It is showing on the left side. You can also see all the databases by SQL command.

Show all created databases

If you want to see all the created databases under localhost write this SQL command and click on go-

SHOW DATABASES;

After that, you will see all the created databases under the localhost.

Delete database/ Drop Database

If you want to delete or drop any database write code like this on the SQL command

DROP DATABASE DATABASE_NAME;

For deleting database “company” write a command like this and click on go.

DROP DATABASE company;

Create database, show databases, drop databases



By this, your created database will be deleted.

Remember that these SQL commands are not case sensitive. If you write in uppercase or in lower case or in both will give the same result.

Finally, we learned-

For creating a database write

CREATE DATABASE DATABASE_NAME;

For showing all the created databases write

SHOW DATABASES;

For deleting specific database write

DELETE DATABASE DATABASE_NAME;

So following these processes you can Create, show, and drop databases. And next, you can create, rename and drop a table.