Learn DBMS and MySQL

Our tutorial provides basic and advance concepts of database management and MySQL commands with detailed examples

DBMS Introduction
MySQL Database
MySQL Tables
MySQL Queries
MySQL Clauses
MySQL Conditions
MySQL Keys

MySQL Create Command

MySQL implements a database as a directory that stores all files in the form of a table. It allows us to create a database mainly in two ways:

  1. MySQL Command Line Client

  2. MySQL Workbench

  3. MySQL Command Line Client

    We can create a new database in MySQL by using the CREATE DATABASE statement with the below syntax:

    CREATE DATABASE [IF NOT EXISTS] database_name  
    [CHARACTER SET charset_name]  
    [COLLATE collation_name];  
    

    The parameter descriptions of the above syntax are as follows:

    database_name It is the name of a new database that should be unique in the MySQL server instance. The IF NOT EXIST clause avoids an error when we create a database that already exists.

    charset_name It is optional. It is the name of the character set to store every character in a string. MySQL database server supports many character sets. If we do not provide this in the statement, MySQL takes the default character set.

    collation_name It is optional that compares characters in a particular character set.

    Let's move on to Select database command in MySQL


    Share this page on :