CREATE TABLE Statement | n | +---+ | 1 | +---+ mysql>  CREATE TABLE bar (m INT) SELECT n FROM foo; Query OK, 1 row affected (0.02 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql>  SELECT * FROM bar; +------+---+ | m | n | +------+---+ | NULL | 1 | +------+---+ 1 row in set (0.00 sec) For each row in table  foo , a row is inserted in  bar  with the values from  foo  and default values for the new columns. In a table resulting from  CREATE TABLE ... SELECT , columns named only in the  CREATE TABLE  part come first. Columns named in both parts or only in the  SELECT  part come after that. The data type of SELECT  columns can be overridden by also specifying the column in the  CREATE TABLE  part. If errors occur while copying data to the table, the table is automatically dropped and not created. However, prior to MySQL 8.0.21, when row-based replication is in use, a  CREATE TABLE ... SELECT  statement is recorded in the binary log as two transactions, one to create the table, and the other to insert data. When the statement applied from the binary log, a failure between the two transactions or while copying data can result in replication of an empty table. That limitation is removed in MySQL 8.0.21. On storage engines that support atomic DDL,  CREATE TABLE ... SELECT  is now recorded and applied as one transaction when row-based replication is in use. For more information, see Section 13.1.1, “Atomic Data Definition Statement Support” . As of MySQL 8.0.21, on storage engines that support both atomic DDL and foreign key constraints, creation of foreign keys is not permitted in  CREATE TABLE ... SELECT  statements when row-based replication is in use. Foreign key constraints can be added later using  ALTER TABLE . You can precede the  SELECT  by  IGNORE  or  REPLACE  to indicate how to handle rows that duplicate unique key values. With  IGNORE , rows that duplicate an existing row on a unique key value are discarded. With REPLACE , new rows replace rows that have the same unique key value. If neither  IGNORE  nor  REPLACE  is specified, duplicate unique key values result in an error. For more information, see The Effect of IGNORE on Statement Execution. In MySQL 8.0.19 and later, you can also use a  VALUES  statement in the  SELECT  part of  CREATE TABLE ... SELECT ; the  VALUES  portion of the statement must include a table alias using an  AS  clause. To name the columns coming from  VALUES , supply column aliases with the table alias; otherwise, the default column names  column_0 ,  column_1 ,  column_2 , ..., are used. Otherwise, naming of columns in the table thus created follows the same rules as described previously in this section. Examples: mysql>  CREATE TABLE tv1 > SELECT * FROM (VALUES ROW(1,3,5), ROW(2,4,6)) AS v; mysql>  TABLE tv1; +----------+----------+----------+ | column_0 | column_1 | column_2 | +----------+----------+----------+ | 1 | 3 | 5 | | 2 | 4 | 6 | +----------+----------+----------+ 2571