[MAX_ROWS [=] max_number_of_rows ] [MIN_ROWS [=] min_number_of_rows ] [TABLESPACE [=] tablespace_name] [( subpartition_definition  [, subpartition_definition ] ...)] subpartition_definition : SUBPARTITION logical_name [[STORAGE] ENGINE [=] engine_name ] [COMMENT [=] ’ string ’ ] [DATA DIRECTORY [=] ’ data_dir ’] [INDEX DIRECTORY [=] ’ index_dir ’] [MAX_ROWS [=] max_number_of_rows ] [MIN_ROWS [=] min_number_of_rows ] [TABLESPACE [=] tablespace_name] query_expression: SELECT ... ( Some valid select or union statement ) 

CREATE TABLE  creates a table with the given name. You must have the CREATE  privilege for the table. 

By default, tables are created in the default database, using the InnoDB  storage engine. An error occurs if the table exists, if there is no default database, or if the database does not exist. 

MySQL has no limit on the number of tables. The underlying file system may have a limit on the number of files that represent tables. Individual storage engines may impose engine-specific constraints. InnoDB permits up to 4 billion tables. 

For information about the physical representation of a table, see Section 13.1.20.1, “Files Created by CREATE TABLE” . 

There are several aspects to the CREATE TABLE  statement, described under the following topics in this section: 

## Table Name 

•Table Name 

•Temporary Tables 

•Table Cloning and Copying 

•Column Data Types and Attributes 

•Indexes, Foreign Keys, and CHECK Constraints 

•Table Options 

•Table Partitioning 

• tbl_name 

The table name can be specified as db_name.tbl_name  to create the table in a specific database. This works regardless of whether there is a default database, assuming that the database exists. If you use quoted identifiers, quote the database and table names separately. For example, write ‘mydb‘.‘mytbl‘ , not ‘mydb.mytbl‘ . 

Rules for permissible table names are given in Section 9.2, “Schema Object Names” . 

• IF NOT EXISTS 

Prevents an error from occurring if the table exists. However, there is no verification that the existing table has a structure identical to that indicated by the CREATE TABLE  statement. 

