CREATE TABLE newtable LIKE oldtable

copy data from one table to another in MySQL

mysql> CREATE TABLE reservation_dev2017 LIKE copy_reserve2017;
mysql> INSERT INTO reservation2_dev017 SELECT * FROM copy_reserve2017;

////////////// OK /////////////

CREATE TABLE copy_reservation2017 LIKE reservation_dev2017
INSERT INTO copy_reserve2017 SELECT * FROM reservation_dev2017

ALTER TABLE copy_reserve2017 ADD formule VARCHAR(30) AFTER etendu;


CREATE TABLE copy_gestion LIKE gestion
INSERT INTO copy_gestion SELECT * FROM gestion

ALTER TABLE copy_gestion ADD formule VARCHAR(30) AFTER mode DEFAULT 'courte'

$_SESSION['table_reservation'] = "copy_reservation2017";	
$_SESSION['table_gestion'] = "copy_gestion";


CREATE TABLE copy_reservation2017 LIKE reservation2017
INSERT INTO copy_reservation2017 SELECT * FROM reservation2017
ALTER TABLE copy_reservation2017 ADD formule VARCHAR(30) AFTER etendu DEFAULT 'courte'

ALTER TABLE tableName ADD newColumn varchar(20) DEFAULT 'test';


CREATE TABLE copy_gestion LIKE gestion
INSERT INTO copy_gestion SELECT * FROM gestion

ALTER TABLE copy_gestion ADD formule VARCHAR(30) AFTER mode 

ALTER TABLE copy_gestion ADD NEW_COL CHAR(25) DEFAULT 'courte' NOT NULL


ALTER TABLE copy_gestion ALTER formule SET DEFAULT 'courte'   OKK

 ALTER TABLE copy_reservation2017 ALTER formule SET DEFAULT 'courte' 
 
 ALTER TABLE copy_reservation2017 ALTER formule SET DEFAULT 1000 
 
 ALTER TABLE copy_reservation2017 ALTER COLUMN formule SET DEFAULT 'literal';