how to select a database in mysql command line code example

Example 1: mysql go into database

USE dbname;

Example 2: mysql select database

//SELECT Database is used in MySQL to select a particular database to work with. This query is used when multiple databases are available with MySQL Server.

//You can use SQL command USE to select a particular database.

Syntax:
USE database_name;

//suppose database name is employee

use employee;

Example 3: mysql create database

CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name
    [create_option] ...

create_option: {
    [DEFAULT] CHARACTER SET [=] charset_name
  | [DEFAULT] COLLATE [=] collation_name
}

Tags:

Sql Example