如何的到创建表的语句呢?
如何得到 创建表的语句呢??
如何得到 创建表的语句呢??
2017-04-15
Create Database If Not Exists test DEFAULT Character Set UTF8; use test; SET names utf8; DROP TABLE IF EXISTS user1; DROP TABLE IF EXISTS user2; DROP TABLE IF EXISTS user_kills; CREATE TABLE IF NOT EXISTS user1 ( id INT NOT NULL AUTO_INCREMENT, user_name VARCHAR(45) NOT NULL , over VARCHAR(45) NOT NULL , PRIMARY KEY(id)) DEFAULT CHARACTER SET = utf8; CREATE TABLE IF NOT EXISTS user2 ( id INT NOT NULL AUTO_INCREMENT, user_name VARCHAR(45) NOT NULL , over VARCHAR(45) NOT NULL , PRIMARY KEY(id)) DEFAULT CHARACTER SET = utf8; CREATE TABLE IF NOT EXISTS user_kills ( id INT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, user_name VARCHAR(45) NOT NULL , timestr DATETIME NOT NULL, kills INT NOT NULL , PRIMARY KEY(id)) DEFAULT CHARACTER SET = utf8; INSERT INTO user1(user_name, over) VALUES ( '唐僧', '旃檀功德佛' ),( '猪八戒', '净坛使者' ),( '孙悟空', '斗战神佛' ),( '沙僧', '金身罗汉' ); INSERT INTO user2(user_name, over) VALUES ( '孙悟空', '成佛' ),( '牛魔王', '被降服' ),( '鹏魔王', '被降服' ),( '蛟魔王', '被降服' ),( '狮骆王', '被降服' ); INSERT INTO user_kills(user_name, timestr, kills, user_id) VALUES ( '孙悟空', '2013-01-11 00:00:00', 20, 3 ),( '沙僧', '2013-01-10 00:00:00', 3, 4 ),( '猪八戒', '2013-01-10 00:00:00', 10, 2 ),( '猪八戒', '2013-02-01 00:00:00', 2, 2 ),( '猪八戒', '2013-02-05 00:00:00', 12, 2 ),( '猪八戒', '2013-02-06 00:00:00', 1, 2 ),( '猪八戒', '2013-02-07 00:00:00', 17, 2 ),( '猪八戒', '2013-02-11 00:00:00', 5, 2 ),( '猪八戒', '2013-02-12 00:00:00', 10, 2 );
举报