DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 (a , c ) ENGINE= ; INSERT INTO t1 (a,c) VALUES (1,'a'),(5,'z'); ALTER TABLE t1 ADD COLUMN b ; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `c` char(8) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER COLUMN a SET DEFAULT '0'; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT 0, `c` char(8) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 ALTER TABLE t1 ALTER a DROP DEFAULT; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11), `c` char(8) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 ALTER TABLE t1 CHANGE COLUMN b b1 FIRST; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `b1` char(8) DEFAULT NULL, `a` int(11), `c` char(8) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 ALTER TABLE t1 CHANGE b1 b AFTER c; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11), `c` char(8) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 ALTER TABLE t1 CHANGE b b ; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11), `c` char(8) DEFAULT NULL, `b` char(8) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 ALTER TABLE t1 MODIFY COLUMN b ; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11), `c` char(8) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 ALTER TABLE t1 MODIFY COLUMN b FIRST; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `b` char(8) DEFAULT NULL, `a` int(11), `c` char(8) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 ALTER TABLE t1 MODIFY COLUMN b AFTER a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11), `b` int(11) DEFAULT NULL, `c` char(8) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 ALTER TABLE t1 DROP COLUMN b; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11), `c` char(8) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 ALTER TABLE t1 RENAME TO t2; SHOW CREATE TABLE t1; ERROR 42S02: Table 'test.t1' doesn't exist SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(11), `c` char(8) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 DROP TABLE t2; CREATE TABLE t1 (a , b ) ENGINE= ; INSERT INTO t1 (a,b) VALUES (1,5),(2,2),(4,3); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 ALTER TABLE t1 ORDER BY b ASC, a DESC; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 SELECT a,b FROM t1; a b 2 2 4 3 1 5 DROP TABLE t1; CREATE TABLE t1 (a , b , c ) ENGINE= CHARACTER SET latin1 COLLATE latin1_general_cs; INSERT INTO t1 (a,b,c) VALUES (5,'z','t'); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` char(8) COLLATE latin1_general_cs DEFAULT NULL, `c` char(8) COLLATE latin1_general_cs DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs ALTER TABLE t1 CONVERT TO CHARACTER SET utf8; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` char(8) DEFAULT NULL, `c` char(8) DEFAULT NULL ) ENGINE= DEFAULT CHARSET=utf8 ALTER TABLE t1 DEFAULT CHARACTER SET = latin1 COLLATE latin1_general_ci; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` char(8) CHARACTER SET utf8 DEFAULT NULL, `c` char(8) CHARACTER SET utf8 DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci ALTER TABLE t1 FORCE; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` char(8) CHARACTER SET utf8 DEFAULT NULL, `c` char(8) CHARACTER SET utf8 DEFAULT NULL ) ENGINE= DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci DROP TABLE t1;