Try the Introductory SQL Course for Free!

CREATE DATABASE Statement- Tutorial

/ / Latest, SQL

CREATE DATABASE Statement: Video Lesson

            This video lesson, titled “The CREATE DATABASE Statement,” shows you how to use the CREATE DATABASE statement in SQL to create databases within many relational database implementations. This video is from our complete introductory SQL course, titled “Mastering Introductory SQL Made Easy v.1.0.”

CREATE DATABASE Statement: Overview

            Within many relational database management systems, the CREATE DATABASE statement is used to create the database. The core SQL of the statement is shown below.

CREATE DATABASE database_name

            In this statement, the “database_name” parameter is the name you want to give to the database. Note that while most versions of SQL will require a semicolon at the end of the statement, some may not. Also, not every vendor implements this SQL command. In Microsoft Access, for example, you create a database using the graphic user interface. SQLite simply uses its own separate command of “sqlite3 database_name” to create a database.

            While this is the bare-bones version of the statement, many vendors will also follow this statement with many vendor-specific clauses that will define the specific characteristics of the database. In MySQL 5.7, for example, the statement “CREATE SCHEMA” is a synonym for “CREATE DATABASE.”

            The following is a listing of hyperlinks that displays the vendor-specific SQL used and the various clauses available for the CREATE DATABASE statement within MySQL 5.7 and SQL Server 2012. Note that this statement is not available as an SQL statement within Access.

MySQL 5.7:

http://dev.mysql.com/doc/refman/5.7/en/create-database.html

SQL Server 2012:

http://technet.microsoft.com/en-us/library/ms176061.aspx

CREATE DATABASE Statement: Syntax

CREATE DATABASE DatabaseName

CREATE DATABASE Statement- Tutorial: A picture of the syntax used by the CREATE DATABASE statement in SQL.

CREATE DATABASE Statement- Tutorial: A picture of the syntax used by the CREATE DATABASE statement in SQL.
TOP