How to Create Database in MySQL

Notes:

How to Create Database in MySQL

How to create database in MySQL server:
- To store and process data of a business, a company, an organization etc.; first step is to create a database for it.
- To create database in MySQL server; we take help of create database command

Basic Syntax:
create database [ if not exists ] databasename;

Ex:
create database db_chidrestechtutorials;
OR
create database if not exists db_ chidrestechtutorials;

Note:
- While creating a database; if you do not specify if not exists clause & the database you want to create already exists in the server then error is thrown.

- While creating a database; if you don’t know whether the database that you want to create already exists in the server or not then you must specify if not exists clause.

- While creating a database; if you know that the database that you want to create does not already exist in the server then you need not to specify if not exists clause.

Interview Questions: