01 / 13

How to create tables?

A MySQL query to create a table must define the structure of a table. The structure consists of the name of a table and names of columns in the table with each column's data type. Note that each table must be uniquely named in a database.

To begin with, the table creation command requires the following details:
  1. 1

    Name of the table.

  2. 2

    Name of the columns.

  3. 3

    Definitions for each column.

Following is the basic SQL syntax to create a MySQL table: