Stats

143 Contributors: 6 Monday, October 10, 2016
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

Creating databases

Syntax

  • CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name [create_specification] /// To create database
  • DROP {DATABASE | SCHEMA} [IF EXISTS] db_name /// To drop database

Parameters

ParameterDetails
CREATE DATABASECreates a database with the given name
CREATE SCHEMAThis is a synonym for CREATE DATABASE
IF NOT EXISTSUsed to avoid execution error, if specified database already exists
create_specificationcreate_specification options specify database characteristics such as CHARACTER SET and COLLATE(database collation)

Related Examples