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. 3601408 fiddles created (47996 in the last week).

CREATE TABLE old_table (column1 INT, column2 VARCHAR(255)); INSERT INTO old_table VALUES (11, 'value 11'), (123, 'value 123'), (12, 'value 1234'), (13, 'value 1313'); SELECT * FROM old_table; SHOW CREATE TABLE old_table;
column1 column2
11 value 11
123 value 123
12 value 1234
13 value 1313
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 old_table; SELECT * FROM new_table; SHOW CREATE TABLE new_table; select max(id) from new_table; insert into new_table set column1='10', column2='michaelangelo'; select max(id) from new_table; SELECT * FROM new_table;
column1 column2
11 value 11
123 value 123
12 value 1234
13 value 1313
id column1 column2
1 11 value 11
2 123 value 123
3 12 value 1234
4 13 value 1313
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=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
max(id)
4
max(id)
8
id column1 column2
1 11 value 11
2 123 value 123
3 12 value 1234
4 13 value 1313
8 10 michaelangelo
 hidden batch(es)