DATABASE Create display and delete

Database is a collection of structured information or data.

Creating a database
CREATE DATABASE my_database;
If the database is already there then MySQL will return error. We can check first before creating the database.
CREATE database IF NOT EXISTS  my_database;

Listing all Databases

SHOW databases;
We can use LIKE to filter the listing of database
SHOW databases LIKE '%plus2%';
This will list all databases having plus2 any where in the database name.

More on SHOW Database and table

Opening a Database

USE my_database;
With this our my_database is available to us.

Deleting Database

DROP DATABASE my_database;
If the database is not available then this will generate error, so we can check before deleting.

SQL Show all tables in Database How to delete tabel or database


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here

    SQL Video Tutorials

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2021 All rights reserved worldwide Privacy Policy Disclaimer