In this article we will see "How to CREATE a Table in MySql" and "MySql CREATE TABLE query syntax with example".

"CREATE TABLE" query syntax

"CREATE TABLE" is used to CREATE a Table in MySql, the syntax is as follow.


CREATE TABLE table_name (
    column1 datatype,
    column2 datatype,
    column3 datatype,
   ....
);

"CREATE TABLE" query example

"CREATE TABLE" is used to CREATE a Table in MySql, as shown in the example below.


/* Use database where the table is going to be created*/
use testDatabase;

/* Create table */
CREATE TABLE testTable (
    id int,
    name varchar(30),
    email varchar(20)
);

Output: Output will be something like this:


Query OK, 0 rows affected (0.11 sec)

In this article we have seen "How to CREATE a Table in MySql", in upcoming articles we will see more about Mysql syntax and queries with example.
  • By Techburps.com
  • Oct 16, 2017
  • MySql