clear markdown compare help best fiddles feedback
clear markdown feedback
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 3601543 fiddles created (47959 in the last week).

CREATE TABLE old_table (column1 INT, column2 VARCHAR(255)); INSERT INTO old_table VALUES (11, 'value 11'), (123, 'value 123'); SELECT * FROM old_table; SHOW CREATE TABLE old_table;
column1 column2
11 value 11
123 value 123
Table Create Table
old_table CREATE TABLE `old_table` ( `column1` int DEFAULT NULL, `column2` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
 hidden batch(es)


CREATE TABLE new_table (id INT AUTO_INCREMENT PRIMARY KEY) SELECT * FROM old_table; SELECT * FROM new_table; SHOW CREATE TABLE new_table;
id column1 column2
1 11 value 11
2 123 value 123
Table Create Table
new_table CREATE TABLE `new_table` ( `id` int NOT NULL AUTO_INCREMENT, `column1` int DEFAULT NULL, `column2` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
 hidden batch(es)