CREATE TABLE tb3(
id SMALLINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(30) NOT NULL
);
id SMALLINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(30) NOT NULL
);
2015-07-17
CREATE TABLE tb1(
username VARCHAR(20),
age TINYINT UNSIGNED,
salary FLOAT(8,2) UNSIGNED
);
username VARCHAR(20),
age TINYINT UNSIGNED,
salary FLOAT(8,2) UNSIGNED
);
2015-07-17
ALTER TABLE user1 DROP PRIMARY KEY;
SHOW COLUMNS FROM user1;
SAHOW INDEXS FROM user2;
ALTER TABLE user1 DROP INDEX username;
SHOW CREATE TABLE user2;
ALTER TABLE user2 DROP FOREIGN KEY user2_ibfk_1;
ALTER TABLE user2 DROP INDEX pid;
SHOW COLUMNS FROM user1;
SAHOW INDEXS FROM user2;
ALTER TABLE user1 DROP INDEX username;
SHOW CREATE TABLE user2;
ALTER TABLE user2 DROP FOREIGN KEY user2_ibfk_1;
ALTER TABLE user2 DROP INDEX pid;
2015-07-15
ALTER TABLE user2 ADD age TINYINT UNSIGNED NOT NULL;
ALTER TABLE user2 ALTER age SET DEFAULT 15;
ALTER TABLE user2 ALTER age DROP default;
ALTER TABLE user2 ALTER age SET DEFAULT 15;
ALTER TABLE user2 ALTER age DROP default;
2015-07-14