gamecenter应用新建表
insert into app_category(category_name) values("网页游戏");
update app_category set category_name = "下载类游戏" where id = 1 ;
insert into app_page(page_name,company,introduction,web_logo_url,wap_logo_url,web_snapshot,wap_snapshot,keyword,display_order,status,source,source_url,add_time) values( "植物大战僵尸","POPCAP","由宝开(PopCap Games)开发的一款社交类休闲游戏。 相对于单机版而言,社区版拥有更变态的竞技玩法,更有趣的僵尸,更多样的道具!当然,还可以让你和好友并肩作战!","www.renren.com/icon.png","http://wap.renren.com/icon.png","由宝开(PopCap Games)开发的一款社交类休闲游戏。","由宝开(PopCap Games)开发的一款社交类休闲游戏。","僵尸","1","0","来源","http://source.url.com","2011-07-11 14:45:23");
insert into app_page(page_name,company,introduction,web_logo_url,wap_logo_url,web_snapshot,wap_snapshot,keyword,display_order,status,source,source_url,add_time) values( "愤怒的小鸟","POPCAP","由宝开(PopCap Games)开发的一款社交类休闲游戏。 相对于单机版而言,社区版拥有更变态的竞技玩法,更有趣的小鸟,更多样的道具!当然,还可以让你和好友并肩作战!","www.renren.com/icon.png","http://wap.renren.com/icon.png","由宝开(PopCap Games)开发的一款社交类休闲游戏。","由宝开(PopCap Games)开发的一款社交类休闲游戏。","小鸟","1","0","来源","http://source.url.com","2011-07-11 15:23:23");
insert into app_page(page_name,company,introduction,web_logo_url,wap_logo_url,web_snapshot,wap_snapshot,keyword,display_order,status,source,source_url,add_time) values( "fruit ninja","POPCAP","由宝开(PopCap Games)开发的一款社交类休闲游戏。 相对于单机版而言,社区版拥有更变态的竞技玩法,更有趣的水果,更多样的道具!当然,还可以让你和好友并肩作战!","www.renren.com/icon.png","http://wap.renren.com/icon.png","由宝开(PopCap Games)开发的一款社交类休闲游戏。","由宝开(PopCap Games)开发的一款社交类休闲游戏。","切水果","1","0","来源","http://source.url.com","2011-07-11 15:26:23");
delete from app_page;
删除头2条,id编号从3开始
truncate table app_page;
truncate table app_category_relation;
truncate table app_page_support;
truncate table app_page_relation;
//这样不但将数据全部删除,而且重新定位自增的字段
insert into app_category_relation(app_page_id,category_id,category_name) values(1,1,"下载类游戏");
insert into app_category_relation(app_page_id,category_id,category_name) values(2,2,"下载类应用");
insert into app_category_relation(app_page_id,category_id,category_name) values(3,1,"网页游戏");
------------------------------------------------
DELIMITER $$
DROP PROCEDURE IF EXISTS `fuxi`.`test3_insert`$$
CREATE DEFINER=``@`` PROCEDURE `test3_insert`()
BEGIN
DECLARE i INT DEFAULT 1;
WHILE i<=1000 DO
insert into app_category_relation(app_page_id,category_id,category_name) values(i,1,"下载类游戏");
SET i=i+1;
insert into app_category_relation(app_page_id,category_id,category_name) values(i,2,"下载类应用");
SET i=i+1;
insert into app_category_relation(app_page_id,category_id,category_name) values(i,3,"网页游戏");
SET i=i+1;
insert into app_category_relation(app_page_id,category_id,category_name) values(i,4,"策略");
SET i=i+1;
insert into app_category_relation(app_page_id,category_id,category_name) values(i,5,"益智");
SET i=i+1;
insert into app_category_relation(app_page_id,category_id,category_name) values(i,6,"棋牌");
SET i=i+1;
insert into app_category_relation(app_page_id,category_id,category_name) values(i,7,"射击");
SET i=i+1;
insert into app_category_relation(app_page_id,category_id,category_name) values(i,8,"RPG");
SET i=i+1;
insert into app_category_relation(app_page_id,category_id,category_name) values(i,9,"DOTA");
SET i=i+1;
END WHILE ;
END$$
DELIMITER ;
------------------------------------------------------------
select * from app_category_relation where category_id = 3
alter table app_page_support change column app_type download_type int;
insert into app_page_support(app_page_id,os,os_version,app_size,download_type,wap_download_url,web_download_url,build_version,release_version,release_note,release_time,app_called) values( "1","0","Iphone","2048kb","1","http://wap.download.com/test.pxl","www.download.com/test.pxl","test v1.0.1","test v1.5.5","注意事项","2011-07-11 15:08:08","appCalled");
insert into app_page_support(app_page_id,os,os_version,app_size,download_type,wap_download_url,web_download_url,build_version,release_version,release_note,release_time,app_called) values( "1","1","Android","2048kb","1","http://wap.download.com/test.apk","www.download.com/test.apk","test v1.0.1","test v1.5.5","注意事项","2011-07-11 15:08:08","appCalled");
insert into app_page_support(app_page_id,os,os_version,app_size,download_type,wap_download_url,web_download_url,build_version,release_version,release_note,release_time,app_called) values( "1","0","Iphone","2048kb","1","http://wap.download.com/test.pxl","www.download.com/test.pxl","test v1.0.1","test v1.5.5","注意事项","2011-07-11 15:08:08","appCalled");
insert into app_page_support(app_page_id,os,os_version,app_size,download_type,wap_download_url,web_download_url,build_version,release_version,release_note,release_time,app_called) values( "1","1","Android","2048kb","1","http://wap.download.com/test.apk","www.download.com/test.apk","test v1.0.1","test v1.5.5","注意事项","2011-07-11 15:08:08","appCalled");
insert into app_page_relation(app_id,app_page_id) values("100001","1");
insert into app_page_relation(app_id,app_page_id) values("100002","1");
insert into app_page_relation(app_id,app_page_id) values("100003","1");
insert into app_page_relation(app_id,app_page_id) values("100004","1");
-------------------------------------------------
DELIMITER $$
DROP PROCEDURE IF EXISTS `fuxi`.`test4_insert`$$
CREATE PROCEDURE `fuxi`.`test4_insert`()
/*LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
| COMMENT 'string'*/
BEGIN
DECLARE i INT DEFAULT 1;
DECLARE k INT DEFAULT 1;
WHILE i<=1000 DO
insert into app_page_relation(app_id,app_page_id) values(100000+i,i);
insert into app_page_relation(app_id,app_page_id) values(101000+i,i);
insert into app_page_relation(app_id,app_page_id) values(102000+i,i);
insert into app_page_relation(app_id,app_page_id) values(103000+i,i);
SET i=i+1;
END WHILE ;
END$$
DELIMITER ;
----------------------------------------------------------------------
批量生成数据:
DELIMITER $$
DROP PROCEDURE IF EXISTS `fuxi`.`test_insert`$$
CREATE PROCEDURE `fuxi`.`test_insert`()
/*LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
| COMMENT 'string'*/
BEGIN
DECLARE i INT DEFAULT 1;
WHILE i<=1000 DO
insert into app_page(page_name,company,introduction,web_logo_url,wap_logo_url,web_snapshot,wap_snapshot,keyword,display_order,status,source,source_url,add_time) values( concat("植物大战僵尸",i),"POPCAP","由宝开(PopCap Games)开发的一款社交类休闲游戏。 相对于单机版而言,社区版拥有更变态的竞技玩法,更有趣的僵尸,更多样的道具!当然,还可以让你和好友并肩作战!","www.renren.com/icon.png","http://wap.renren.com/icon.png","由宝开(PopCap Games)开发的一款社交类休闲游戏。","由宝开(PopCap Games)开发的一款社交类休闲游戏。","僵尸","1","0","来源","http://source.url.com","2011-07-11 14:45:23");
SET i=i+1;
END WHILE ;
END$$
DELIMITER ;
---------------------------------------
show variables like "char";
set character_set_client = utf8;
set character_set_connection = utf8;
set character_set_results = utf8;
---------------------------------------
DELIMITER $$
DROP PROCEDURE IF EXISTS `fuxi`.`test2_insert`$$
CREATE PROCEDURE `fuxi`.`test2_insert`()
/*LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
| COMMENT 'string'*/
BEGIN
DECLARE i INT DEFAULT 1;
WHILE i<=1000 DO
insert into app_page_support(app_page_id,os,os_version,app_size,download_type,wap_download_url,web_download_url,build_version,release_version,release_note,release_time,app_called) values( i,"0","iphone","2048kb","1","http://wap.download.com/test.pxl","www.download.com/test.pxl","test v1.0.1","test v1.5.5","注意事项","2011-07-11 15:08:08","appCalled");
insert into app_page_support(app_page_id,os,os_version,app_size,download_type,wap_download_url,web_download_url,build_version,release_version,release_note,release_time,app_called) values( i,"1","ipad","2048kb","1","http://wap.download.com/test.apk","www.download.com/test.apk","test v1.0.1","test v1.5.5","注意事项","2011-07-11 15:08:08","appCalled");
insert into app_page_support(app_page_id,os,os_version,app_size,download_type,wap_download_url,web_download_url,build_version,release_version,release_note,release_time,app_called) values( i,"1","Android","2048kb","1","http://wap.download.com/test.apk","www.download.com/test.apk","test v1.0.1","test v1.5.5","注意事项","2011-07-11 15:08:08","appCalled");
insert into app_page_support(app_page_id,os,os_version,app_size,download_type,wap_download_url,web_download_url,build_version,release_version,release_note,release_time,app_called) values( i,"1","pad","2048kb","1","http://wap.download.com/test.apk","www.download.com/test.apk","test v1.0.1","test v1.5.5","注意事项","2011-07-11 15:08:08","appCalled");
SET i=i+1;
END WHILE ;
END$$
DELIMITER ;
----------------------------------
改字段值
UPDATE app_page_support set release_name = '植物大战僵尸'
UPDATE app_page set web_snapshot = "[{name:图片1,url:'http://a.xnimg.cn/imgpro/app/gamepage/game_img001.jpg', thumbnail:'http://a.xnimg.cn/imgpro/app/gamepage/small_img001.jpg', displayOrder:1},{name:图片2,url:'http://a.xnimg.cn/imgpro/app/gamepage/game_img002.jpg', thumbnail:'http://a.xnimg.cn/imgpro/app/gamepage/small_img002.jpg',displayOrder:2},{name:图片3,url:'http://a.xnimg.cn/imgpro/app/gamepage/game_img003.jpg', thumbnail:'http://a.xnimg.cn/imgpro/app/gamepage/small_img003.jpg', displayOrder:3}]";
UPDATE app_page set wap_snapshot = "[{name:图片1,url:'http://a.xnimg.cn/imgpro/app/gamepage/game_img001.jpg', thumbnail:'http://a.xnimg.cn/imgpro/app/gamepage/small_img001.jpg', displayOrder:1},{name:图片2,url:'http://a.xnimg.cn/imgpro/app/gamepage/game_img002.jpg', thumbnail:'http://a.xnimg.cn/imgpro/app/gamepage/small_img002.jpg',displayOrder:2},{name:图片3,url:'http://a.xnimg.cn/imgpro/app/gamepage/game_img003.jpg', thumbnail:'http://a.xnimg.cn/imgpro/app/gamepage/small_img003.jpg', displayOrder:3}]";
insert into user_access_flow(user_id,access,add_time) values(9,0,"2011-07-20 22:08:08");
--------------------
mysql -u root -p --default-character-set=utf8
插数据工具:http://www.pentaho.com/
http://sourceforge.net/projects/pentaho/files/Data%20Integration/4.1.0-stable/