利用sql语句建立全国省市区三级数据库
一、创建数据库zone
CREATE DATABASE IF ONT EXISTS zone;
二、建立省级表并增加数据
DROP TABLE IF EXISTS `provinces`;
CREATE TABLE `provinces` (
`id` int(11) NOT NULL auto_increment,
`provinceid` varchar(20) NOT NULL,
`province` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='省份信息表' AUTO_INCREMENT=35 ;
插入省级表数据:
insert into provinces(id,provinceid,province) values(1,'','北京市');
insert into provinces(id,provinceid,province) values(2,'','天津市');
insert into provinces(id,provinceid,province) values(3,'','河北省');
insert into provinces(id,provinceid,province) values(4,'','山西省');
insert into provinces(id,provinceid,province) values(5,'','内蒙古自治区');
insert into provinces(id,provinceid,province) values(6,'','辽宁省');
insert into provinces(id,provinceid,province) values(7,'','吉林省');
insert into provinces(id,provinceid,province) values(8,'','黑龙江省');
insert into provinces(id,provinceid,province) values(9,'','上海市');
insert into provinces(id,provinceid,province) values(10,'','江苏省');
insert into provinces(id,provinceid,province) values(11,'','浙江省');
insert into provinces(id,provinceid,province) values(12,'','安徽省');
insert into provinces(id,provinceid,province) values(13,'','福建省');
insert into provinces(id,provinceid,province) values(14,'','江西省');
insert into provinces(id,provinceid,province) values(15,'','山东省');
insert into provinces(id,provinceid,province) values(16,'','河南省');
insert into provinces(id,provinceid,province) values(17,'','湖北省');
insert into provinces(id,provinceid,province) values(18,'','湖南省');
insert into provinces(id,provinceid,province) values(19,'','广东省');
insert into provinces(id,provinceid,province) values(20,'','广西壮族自治区');
insert into provinces(id,provinceid,province) values(21,'','海南省');
insert into provinces(id,provinceid,province) values(22,'','重庆市');
insert into provinces(id,provinceid,province) values(23,'','四川省');
insert into provinces(id,provinceid,province) values(24,'','贵州省');
insert into provinces(id,provinceid,province) values(25,'','云南省');
insert into provinces(id,provinceid,province) values(26,'','西藏自治区');
insert into provinces(id,provinceid,province) values(27,'','陕西省');
insert into provinces(id,provinceid,province) values(28,'','甘肃省');
insert into provinces(id,provinceid,province) values(29,'','青海省');
insert into provinces(id,provinceid,province) values(30,'','宁夏回族自治区');
insert into provinces(id,provinceid,province) values(31,'','新疆维吾尔自治区');
insert into provinces(id,provinceid,province) values(32,'','台湾省');
insert into provinces(id,provinceid,province) values(33,'','香港特别行政区');
insert into provinces(id,provinceid,province) values(34,'','澳门特别行政区');
三、建立市级表并增加数据
DROP TABLE IF EXISTS `cities`;
CREATE TABLE `cities` (
`id` int(11) NOT NULL auto_increment,
`cityid` varchar(20) NOT NULL,
`city` varchar(50) NOT NULL,
`provinceid` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='行政区域地州市信息表' AUTO_INCREMENT=346 ;
插入数据:
insert into cities(id,cityid,city,provinceid) values(1,'','市辖区','');
insert into cities(id,cityid,city,provinceid) values(2,'','县','');
insert into cities(id,cityid,city,provinceid) values(3,'','市辖区','');
insert into cities(id,cityid,city,provinceid) values(4,'','县','');
insert into cities(id,cityid,city,provinceid) values(5,'','石家庄市','');
insert into cities(id,cityid,city,provinceid) values(6,'','唐山市','');
insert into cities(id,cityid,city,provinceid) values(7,'','秦皇岛市','');
insert into cities(id,cityid,city,provinceid) values(8,'','邯郸市','');
insert into cities(id,cityid,city,provinceid) values(9,'','邢台市','');
insert into cities(id,cityid,city,provinceid) values(10,'','保定市','');
insert into cities(id,cityid,city,provinceid) values(11,'','张家口市','');
insert into cities(id,cityid,city,provinceid) values(12,'','承德市','');
insert into cities(id,cityid,city,provinceid) values(13,'','沧州市','');
insert into cities(id,cityid,city,provinceid) values(14,'','廊坊市','');
insert into cities(id,cityid,city,provinceid) values(15,'','衡水市','');
insert into cities(id,cityid,city,provinceid) values(16,'','太原市','');
insert into cities(id,cityid,city,provinceid) values(17,'','大同市','');
insert into cities(id,cityid,city,provinceid) values(18,'','阳泉市','');
insert into cities(id,cityid,city,provinceid) values(19,'','长治市','');
insert into cities(id,cityid,city,provinceid) values(20,'','晋城市','');
insert into cities(id,cityid,city,provinceid) values(21,'','朔州市','');
insert into cities(id,cityid,city,provinceid) values(22,'','晋中市','');
insert into cities(id,cityid,city,provinceid) values(23,'','运城市','');
insert into cities(id,cityid,city,provinceid) values(24,'','忻州市','');
insert into cities(id,cityid,city,provinceid) values(25,'','临汾市','');
insert into cities(id,cityid,city,provinceid) values(26,'','吕梁市','');
insert into cities(id,cityid,city,provinceid) values(27,'','呼和浩特市','');
insert into cities(id,cityid,city,provinceid) values(28,'','包头市','');
insert into cities(id,cityid,city,provinceid) values(29,'','乌海市','');
insert into cities(id,cityid,city,provinceid) values(30,'','赤峰市','');
insert into cities(id,cityid,city,provinceid) values(31,'','通辽市','');
insert into cities(id,cityid,city,provinceid) values(32,'','鄂尔多斯市','');
insert into cities(id,cityid,city,provinceid) values(33,'','呼伦贝尔市','');
insert into cities(id,cityid,city,provinceid) values(34,'','巴彦淖尔市','');
insert into cities(id,cityid,city,provinceid) values(35,'','乌兰察布市','');
insert into cities(id,cityid,city,provinceid) values(36,'','兴安盟','');
insert into cities(id,cityid,city,provinceid) values(37,'','锡林郭勒盟','');
insert into cities(id,cityid,city,provinceid) values(38,'','阿拉善盟','');
insert into cities(id,cityid,city,provinceid) values(39,'','沈阳市','');
insert into cities(id,cityid,city,provinceid) values(40,'','大连市','');
insert into cities(id,cityid,city,provinceid) values(41,'','鞍山市','');
insert into cities(id,cityid,city,provinceid) values(42,'','抚顺市','');
insert into cities(id,cityid,city,provinceid) values(43,'','本溪市','');
insert into cities(id,cityid,city,provinceid) values(44,'','丹东市','');
insert into cities(id,cityid,city,provinceid) values(45,'','锦州市','');
insert into cities(id,cityid,city,provinceid) values(46,'','营口市','');
insert into cities(id,cityid,city,provinceid) values(47,'','阜新市','');
insert into cities(id,cityid,city,provinceid) values(48,'','辽阳市','');
insert into cities(id,cityid,city,provinceid) values(49,'','盘锦市','');
insert into cities(id,cityid,city,provinceid) values(50,'','铁岭市','');
insert into cities(id,cityid,city,provinceid) values(51,'','朝阳市','');
insert into cities(id,cityid,city,provinceid) values(52,'','葫芦岛市','');
insert into cities(id,cityid,city,provinceid) values(53,'','长春市','');
insert into cities(id,cityid,city,provinceid) values(54,'','吉林市','');
insert into cities(id,cityid,city,provinceid) values(55,'','四平市','');
insert into cities(id,cityid,city,provinceid) values(56,'','辽源市','');
insert into cities(id,cityid,city,provinceid) values(57,'','通化市','');
insert into cities(id,cityid,city,provinceid) values(58,'','白山市','');
insert into cities(id,cityid,city,provinceid) values(59,'','松原市','');
insert into cities(id,cityid,city,provinceid) values(60,'','白城市','');
insert into cities(id,cityid,city,provinceid) values(61,'','延边朝鲜族自治州','');
insert into cities(id,cityid,city,provinceid) values(62,'','哈尔滨市','');
insert into cities(id,cityid,city,provinceid) values(63,'','齐齐哈尔市','');
insert into cities(id,cityid,city,provinceid) values(64,'','鸡西市','');
insert into cities(id,cityid,city,provinceid) values(65,'','鹤岗市','');
insert into cities(id,cityid,city,provinceid) values(66,'','双鸭山市','');
insert into cities(id,cityid,city,provinceid) values(67,'','大庆市','');
insert into cities(id,cityid,city,provinceid) values(68,'','伊春市','');
insert into cities(id,cityid,city,provinceid) values(69,'','佳木斯市','');
insert into cities(id,cityid,city,provinceid) values(70,'','七台河市','');
insert into cities(id,cityid,city,provinceid) values(71,'','牡丹江市','');
insert into cities(id,cityid,city,provinceid) values(72,'','黑河市','');
insert into cities(id,cityid,city,provinceid) values(73,'','绥化市','');
insert into cities(id,cityid,city,provinceid) values(74,'','大兴安岭地区','');
insert into cities(id,cityid,city,provinceid) values(75,'','市辖区','');
insert into cities(id,cityid,city,provinceid) values(76,'','县','');
insert into cities(id,cityid,city,provinceid) values(77,'','南京市','');
insert into cities(id,cityid,city,provinceid) values(78,'','无锡市','');
insert into cities(id,cityid,city,provinceid) values(79,'','徐州市','');
insert into cities(id,cityid,city,provinceid) values(80,'','常州市','');
insert into cities(id,cityid,city,provinceid) values(81,'','苏州市','');
insert into cities(id,cityid,city,provinceid) values(82,'','南通市','');
insert into cities(id,cityid,city,provinceid) values(83,'','连云港市','');
insert into cities(id,cityid,city,provinceid) values(84,'','淮安市','');
insert into cities(id,cityid,city,provinceid) values(85,'','盐城市','');
insert into cities(id,cityid,city,provinceid) values(86,'','扬州市','');
insert into cities(id,cityid,city,provinceid) values(87,'','镇江市','');
insert into cities(id,cityid,city,provinceid) values(88,'','泰州市','');
insert into cities(id,cityid,city,provinceid) values(89,'','宿迁市','');
insert into cities(id,cityid,city,provinceid) values(90,'','杭州市','');
insert into cities(id,cityid,city,provinceid) values(91,'','宁波市','');
insert into cities(id,cityid,city,provinceid) values(92,'','温州市','');
insert into cities(id,cityid,city,provinceid) values(93,'','嘉兴市','');
insert into cities(id,cityid,city,provinceid) values(94,'','湖州市','');
insert into cities(id,cityid,city,provinceid) values(95,'','绍兴市','');
insert into cities(id,cityid,city,provinceid) values(96,'','金华市','');
insert into cities(id,cityid,city,provinceid) values(97,'','衢州市','');
insert into cities(id,cityid,city,provinceid) values(98,'','舟山市','');
insert into cities(id,cityid,city,provinceid) values(99,'','台州市','');
insert into cities(id,cityid,city,provinceid) values(100,'','丽水市','');
insert into cities(id,cityid,city,provinceid) values(101,'','合肥市','');
insert into cities(id,cityid,city,provinceid) values(102,'','芜湖市','');
insert into cities(id,cityid,city,provinceid) values(103,'','蚌埠市','');
insert into cities(id,cityid,city,provinceid) values(104,'','淮南市','');
insert into cities(id,cityid,city,provinceid) values(105,'','马鞍山市','');
insert into cities(id,cityid,city,provinceid) values(106,'','淮北市','');
insert into cities(id,cityid,city,provinceid) values(107,'','铜陵市','');
insert into cities(id,cityid,city,provinceid) values(108,'','安庆市','');
insert into cities(id,cityid,city,provinceid) values(109,'','黄山市','');
insert into cities(id,cityid,city,provinceid) values(110,'','滁州市','');
insert into cities(id,cityid,city,provinceid) values(111,'','阜阳市','');
insert into cities(id,cityid,city,provinceid) values(112,'','宿州市','');
insert into cities(id,cityid,city,provinceid) values(113,'','巢湖市','');
insert into cities(id,cityid,city,provinceid) values(114,'','六安市','');
insert into cities(id,cityid,city,provinceid) values(115,'','亳州市','');
insert into cities(id,cityid,city,provinceid) values(116,'','池州市','');
insert into cities(id,cityid,city,provinceid) values(117,'','宣城市','');
insert into cities(id,cityid,city,provinceid) values(118,'','福州市','');
insert into cities(id,cityid,city,provinceid) values(119,'','厦门市','');
insert into cities(id,cityid,city,provinceid) values(120,'','莆田市','');
insert into cities(id,cityid,city,provinceid) values(121,'','三明市','');
insert into cities(id,cityid,city,provinceid) values(122,'','泉州市','');
insert into cities(id,cityid,city,provinceid) values(123,'','漳州市','');
insert into cities(id,cityid,city,provinceid) values(124,'','南平市','');
insert into cities(id,cityid,city,provinceid) values(125,'','龙岩市','');
insert into cities(id,cityid,city,provinceid) values(126,'','宁德市','');
insert into cities(id,cityid,city,provinceid) values(127,'','南昌市','');
insert into cities(id,cityid,city,provinceid) values(128,'','景德镇市','');
insert into cities(id,cityid,city,provinceid) values(129,'','萍乡市','');
insert into cities(id,cityid,city,provinceid) values(130,'','九江市','');
insert into cities(id,cityid,city,provinceid) values(131,'','新余市','');
insert into cities(id,cityid,city,provinceid) values(132,'','鹰潭市','');
insert into cities(id,cityid,city,provinceid) values(133,'','赣州市','');
insert into cities(id,cityid,city,provinceid) values(134,'','吉安市','');
insert into cities(id,cityid,city,provinceid) values(135,'','宜春市','');
insert into cities(id,cityid,city,provinceid) values(136,'','抚州市','');
insert into cities(id,cityid,city,provinceid) values(137,'','上饶市','');
insert into cities(id,cityid,city,provinceid) values(138,'','济南市','');
insert into cities(id,cityid,city,provinceid) values(139,'','青岛市','');
insert into cities(id,cityid,city,provinceid) values(140,'','淄博市','');
insert into cities(id,cityid,city,provinceid) values(141,'','枣庄市','');
insert into cities(id,cityid,city,provinceid) values(142,'','东营市','');
insert into cities(id,cityid,city,provinceid) values(143,'','烟台市','');
insert into cities(id,cityid,city,provinceid) values(144,'','潍坊市','');
insert into cities(id,cityid,city,provinceid) values(145,'','济宁市','');
insert into cities(id,cityid,city,provinceid) values(146,'','泰安市','');
insert into cities(id,cityid,city,provinceid) values(147,'','威海市','');
insert into cities(id,cityid,city,provinceid) values(148,'','日照市','');
insert into cities(id,cityid,city,provinceid) values(149,'','莱芜市','');
insert into cities(id,cityid,city,provinceid) values(150,'','临沂市','');
insert into cities(id,cityid,city,provinceid) values(151,'','德州市','');
insert into cities(id,cityid,city,provinceid) values(152,'','聊城市','');
insert into cities(id,cityid,city,provinceid) values(153,'','滨州市','');
insert into cities(id,cityid,city,provinceid) values(154,'','荷泽市','');
insert into cities(id,cityid,city,provinceid) values(155,'','郑州市','');
insert into cities(id,cityid,city,provinceid) values(156,'','开封市','');
insert into cities(id,cityid,city,provinceid) values(157,'','洛阳市','');
insert into cities(id,cityid,city,provinceid) values(158,'','平顶山市','');
insert into cities(id,cityid,city,provinceid) values(159,'','安阳市','');
insert into cities(id,cityid,city,provinceid) values(160,'','鹤壁市','');
insert into cities(id,cityid,city,provinceid) values(161,'','新乡市','');
insert into cities(id,cityid,city,provinceid) values(162,'','焦作市','');
insert into cities(id,cityid,city,provinceid) values(163,'','濮阳市','');
insert into cities(id,cityid,city,provinceid) values(164,'','许昌市','');
insert into cities(id,cityid,city,provinceid) values(165,'','漯河市','');
insert into cities(id,cityid,city,provinceid) values(166,'','三门峡市','');
insert into cities(id,cityid,city,provinceid) values(167,'','南阳市','');
insert into cities(id,cityid,city,provinceid) values(168,'','商丘市','');
insert into cities(id,cityid,city,provinceid) values(169,'','信阳市','');
insert into cities(id,cityid,city,provinceid) values(170,'','周口市','');
insert into cities(id,cityid,city,provinceid) values(171,'','驻马店市','');
insert into cities(id,cityid,city,provinceid) values(172,'','武汉市','');
insert into cities(id,cityid,city,provinceid) values(173,'','黄石市','');
insert into cities(id,cityid,city,provinceid) values(174,'','十堰市','');
insert into cities(id,cityid,city,provinceid) values(175,'','宜昌市','');
insert into cities(id,cityid,city,provinceid) values(176,'','襄樊市','');
insert into cities(id,cityid,city,provinceid) values(177,'','鄂州市','');
insert into cities(id,cityid,city,provinceid) values(178,'','荆门市','');
insert into cities(id,cityid,city,provinceid) values(179,'','孝感市','');
insert into cities(id,cityid,city,provinceid) values(180,'','荆州市','');
insert into cities(id,cityid,city,provinceid) values(181,'','黄冈市','');
insert into cities(id,cityid,city,provinceid) values(182,'','咸宁市','');
insert into cities(id,cityid,city,provinceid) values(183,'','随州市','');
insert into cities(id,cityid,city,provinceid) values(184,'','恩施土家族苗族自治州','');
insert into cities(id,cityid,city,provinceid) values(185,'','省直辖行政单位','');
insert into cities(id,cityid,city,provinceid) values(186,'','长沙市','');
insert into cities(id,cityid,city,provinceid) values(187,'','株洲市','');
insert into cities(id,cityid,city,provinceid) values(188,'','湘潭市','');
insert into cities(id,cityid,city,provinceid) values(189,'','衡阳市','');
insert into cities(id,cityid,city,provinceid) values(190,'','邵阳市','');
insert into cities(id,cityid,city,provinceid) values(191,'','岳阳市','');
insert into cities(id,cityid,city,provinceid) values(192,'','常德市','');
insert into cities(id,cityid,city,provinceid) values(193,'','张家界市','');
insert into cities(id,cityid,city,provinceid) values(194,'','益阳市','');
insert into cities(id,cityid,city,provinceid) values(195,'','郴州市','');
insert into cities(id,cityid,city,provinceid) values(196,'','永州市','');
insert into cities(id,cityid,city,provinceid) values(197,'','怀化市','');
insert into cities(id,cityid,city,provinceid) values(198,'','娄底市','');
insert into cities(id,cityid,city,provinceid) values(199,'','湘西土家族苗族自治州','');
insert into cities(id,cityid,city,provinceid) values(200,'','广州市','');
insert into cities(id,cityid,city,provinceid) values(201,'','韶关市','');
insert into cities(id,cityid,city,provinceid) values(202,'','深圳市','');
insert into cities(id,cityid,city,provinceid) values(203,'','珠海市','');
insert into cities(id,cityid,city,provinceid) values(204,'','汕头市','');
insert into cities(id,cityid,city,provinceid) values(205,'','佛山市','');
insert into cities(id,cityid,city,provinceid) values(206,'','江门市','');
insert into cities(id,cityid,city,provinceid) values(207,'','湛江市','');
insert into cities(id,cityid,city,provinceid) values(208,'','茂名市','');
insert into cities(id,cityid,city,provinceid) values(209,'','肇庆市','');
insert into cities(id,cityid,city,provinceid) values(210,'','惠州市','');
insert into cities(id,cityid,city,provinceid) values(211,'','梅州市','');
insert into cities(id,cityid,city,provinceid) values(212,'','汕尾市','');
insert into cities(id,cityid,city,provinceid) values(213,'','河源市','');
insert into cities(id,cityid,city,provinceid) values(214,'','阳江市','');
insert into cities(id,cityid,city,provinceid) values(215,'','清远市','');
insert into cities(id,cityid,city,provinceid) values(216,'','东莞市','');
insert into cities(id,cityid,city,provinceid) values(217,'','中山市','');
insert into cities(id,cityid,city,provinceid) values(218,'','潮州市','');
insert into cities(id,cityid,city,provinceid) values(219,'','揭阳市','');
insert into cities(id,cityid,city,provinceid) values(220,'','云浮市','');
insert into cities(id,cityid,city,provinceid) values(221,'','南宁市','');
insert into cities(id,cityid,city,provinceid) values(222,'','柳州市','');
insert into cities(id,cityid,city,provinceid) values(223,'','桂林市','');
insert into cities(id,cityid,city,provinceid) values(224,'','梧州市','');
insert into cities(id,cityid,city,provinceid) values(225,'','北海市','');
insert into cities(id,cityid,city,provinceid) values(226,'','防城港市','');
insert into cities(id,cityid,city,provinceid) values(227,'','钦州市','');
insert into cities(id,cityid,city,provinceid) values(228,'','贵港市','');
insert into cities(id,cityid,city,provinceid) values(229,'','玉林市','');
insert into cities(id,cityid,city,provinceid) values(230,'','百色市','');
insert into cities(id,cityid,city,provinceid) values(231,'','贺州市','');
insert into cities(id,cityid,city,provinceid) values(232,'','河池市','');
insert into cities(id,cityid,city,provinceid) values(233,'','来宾市','');
insert into cities(id,cityid,city,provinceid) values(234,'','崇左市','');
insert into cities(id,cityid,city,provinceid) values(235,'','海口市','');
insert into cities(id,cityid,city,provinceid) values(236,'','三亚市','');
insert into cities(id,cityid,city,provinceid) values(237,'','省直辖县级行政单位','');
insert into cities(id,cityid,city,provinceid) values(238,'','市辖区','');
insert into cities(id,cityid,city,provinceid) values(239,'','县','');
insert into cities(id,cityid,city,provinceid) values(240,'','市','');
insert into cities(id,cityid,city,provinceid) values(241,'','成都市','');
insert into cities(id,cityid,city,provinceid) values(242,'','自贡市','');
insert into cities(id,cityid,city,provinceid) values(243,'','攀枝花市','');
insert into cities(id,cityid,city,provinceid) values(244,'','泸州市','');
insert into cities(id,cityid,city,provinceid) values(245,'','德阳市','');
insert into cities(id,cityid,city,provinceid) values(246,'','绵阳市','');
insert into cities(id,cityid,city,provinceid) values(247,'','广元市','');
insert into cities(id,cityid,city,provinceid) values(248,'','遂宁市','');
insert into cities(id,cityid,city,provinceid) values(249,'','内江市','');
insert into cities(id,cityid,city,provinceid) values(250,'','乐山市','');
insert into cities(id,cityid,city,provinceid) values(251,'','南充市','');
insert into cities(id,cityid,city,provinceid) values(252,'','眉山市','');
insert into cities(id,cityid,city,provinceid) values(253,'','宜宾市','');
insert into cities(id,cityid,city,provinceid) values(254,'','广安市','');
insert into cities(id,cityid,city,provinceid) values(255,'','达州市','');
insert into cities(id,cityid,city,provinceid) values(256,'','雅安市','');
insert into cities(id,cityid,city,provinceid) values(257,'','巴中市','');
insert into cities(id,cityid,city,provinceid) values(258,'','资阳市','');
insert into cities(id,cityid,city,provinceid) values(259,'','阿坝藏族羌族自治州','');
insert into cities(id,cityid,city,provinceid) values(260,'','甘孜藏族自治州','');
insert into cities(id,cityid,city,provinceid) values(261,'','凉山彝族自治州','');
insert into cities(id,cityid,city,provinceid) values(262,'','贵阳市','');
insert into cities(id,cityid,city,provinceid) values(263,'','六盘水市','');
insert into cities(id,cityid,city,provinceid) values(264,'','遵义市','');
insert into cities(id,cityid,city,provinceid) values(265,'','安顺市','');
insert into cities(id,cityid,city,provinceid) values(266,'','铜仁地区','');
insert into cities(id,cityid,city,provinceid) values(267,'','黔西南布依族苗族自治州','');
insert into cities(id,cityid,city,provinceid) values(268,'','毕节地区','');
insert into cities(id,cityid,city,provinceid) values(269,'','黔东南苗族侗族自治州','');
insert into cities(id,cityid,city,provinceid) values(270,'','黔南布依族苗族自治州','');
insert into cities(id,cityid,city,provinceid) values(271,'','昆明市','');
insert into cities(id,cityid,city,provinceid) values(272,'','曲靖市','');
insert into cities(id,cityid,city,provinceid) values(273,'','玉溪市','');
insert into cities(id,cityid,city,provinceid) values(274,'','保山市','');
insert into cities(id,cityid,city,provinceid) values(275,'','昭通市','');
insert into cities(id,cityid,city,provinceid) values(276,'','丽江市','');
insert into cities(id,cityid,city,provinceid) values(277,'','思茅市','');
insert into cities(id,cityid,city,provinceid) values(278,'','临沧市','');
insert into cities(id,cityid,city,provinceid) values(279,'','楚雄彝族自治州','');
insert into cities(id,cityid,city,provinceid) values(280,'','红河哈尼族彝族自治州','');
insert into cities(id,cityid,city,provinceid) values(281,'','文山壮族苗族自治州','');
insert into cities(id,cityid,city,provinceid) values(282,'','西双版纳傣族自治州','');
insert into cities(id,cityid,city,provinceid) values(283,'','大理白族自治州','');
insert into cities(id,cityid,city,provinceid) values(284,'','德宏傣族景颇族自治州','');
insert into cities(id,cityid,city,provinceid) values(285,'','怒江傈僳族自治州','');
insert into cities(id,cityid,city,provinceid) values(286,'','迪庆藏族自治州','');
insert into cities(id,cityid,city,provinceid) values(287,'','拉萨市','');
insert into cities(id,cityid,city,provinceid) values(288,'','昌都地区','');
insert into cities(id,cityid,city,provinceid) values(289,'','山南地区','');
insert into cities(id,cityid,city,provinceid) values(290,'','日喀则地区','');
insert into cities(id,cityid,city,provinceid) values(291,'','那曲地区','');
insert into cities(id,cityid,city,provinceid) values(292,'','阿里地区','');
insert into cities(id,cityid,city,provinceid) values(293,'','林芝地区','');
insert into cities(id,cityid,city,provinceid) values(294,'','西安市','');
insert into cities(id,cityid,city,provinceid) values(295,'','铜川市','');
insert into cities(id,cityid,city,provinceid) values(296,'','宝鸡市','');
insert into cities(id,cityid,city,provinceid) values(297,'','咸阳市','');
insert into cities(id,cityid,city,provinceid) values(298,'','渭南市','');
insert into cities(id,cityid,city,provinceid) values(299,'','延安市','');
insert into cities(id,cityid,city,provinceid) values(300,'','汉中市','');
insert into cities(id,cityid,city,provinceid) values(301,'','榆林市','');
insert into cities(id,cityid,city,provinceid) values(302,'','安康市','');
insert into cities(id,cityid,city,provinceid) values(303,'','商洛市','');
insert into cities(id,cityid,city,provinceid) values(304,'','兰州市','');
insert into cities(id,cityid,city,provinceid) values(305,'','嘉峪关市','');
insert into cities(id,cityid,city,provinceid) values(306,'','金昌市','');
insert into cities(id,cityid,city,provinceid) values(307,'','白银市','');
insert into cities(id,cityid,city,provinceid) values(308,'','天水市','');
insert into cities(id,cityid,city,provinceid) values(309,'','武威市','');
insert into cities(id,cityid,city,provinceid) values(310,'','张掖市','');
insert into cities(id,cityid,city,provinceid) values(311,'','平凉市','');
insert into cities(id,cityid,city,provinceid) values(312,'','酒泉市','');
insert into cities(id,cityid,city,provinceid) values(313,'','庆阳市','');
insert into cities(id,cityid,city,provinceid) values(314,'','定西市','');
insert into cities(id,cityid,city,provinceid) values(315,'','陇南市','');
insert into cities(id,cityid,city,provinceid) values(316,'','临夏回族自治州','');
insert into cities(id,cityid,city,provinceid) values(317,'','甘南藏族自治州','');
insert into cities(id,cityid,city,provinceid) values(318,'','西宁市','');
insert into cities(id,cityid,city,provinceid) values(319,'','海东地区','');
insert into cities(id,cityid,city,provinceid) values(320,'','海北藏族自治州','');
insert into cities(id,cityid,city,provinceid) values(321,'','黄南藏族自治州','');
insert into cities(id,cityid,city,provinceid) values(322,'','海南藏族自治州','');
insert into cities(id,cityid,city,provinceid) values(323,'','果洛藏族自治州','');
insert into cities(id,cityid,city,provinceid) values(324,'','玉树藏族自治州','');
insert into cities(id,cityid,city,provinceid) values(325,'','海西蒙古族藏族自治州','');
insert into cities(id,cityid,city,provinceid) values(326,'','银川市','');
insert into cities(id,cityid,city,provinceid) values(327,'','石嘴山市','');
insert into cities(id,cityid,city,provinceid) values(328,'','吴忠市','');
insert into cities(id,cityid,city,provinceid) values(329,'','固原市','');
insert into cities(id,cityid,city,provinceid) values(330,'','中卫市','');
insert into cities(id,cityid,city,provinceid) values(331,'','乌鲁木齐市','');
insert into cities(id,cityid,city,provinceid) values(332,'','克拉玛依市','');
insert into cities(id,cityid,city,provinceid) values(333,'','吐鲁番地区','');
insert into cities(id,cityid,city,provinceid) values(334,'','哈密地区','');
insert into cities(id,cityid,city,provinceid) values(335,'','昌吉回族自治州','');
insert into cities(id,cityid,city,provinceid) values(336,'','博尔塔拉蒙古自治州','');
insert into cities(id,cityid,city,provinceid) values(337,'','巴音郭楞蒙古自治州','');
insert into cities(id,cityid,city,provinceid) values(338,'','阿克苏地区','');
insert into cities(id,cityid,city,provinceid) values(339,'','克孜勒苏柯尔克孜自治州','');
insert into cities(id,cityid,city,provinceid) values(340,'','喀什地区','');
insert into cities(id,cityid,city,provinceid) values(341,'','和田地区','');
insert into cities(id,cityid,city,provinceid) values(342,'','伊犁哈萨克自治州','');
insert into cities(id,cityid,city,provinceid) values(343,'','塔城地区','');
insert into cities(id,cityid,city,provinceid) values(344,'','阿勒泰地区','');
insert into cities(id,cityid,city,provinceid) values(345,'','省直辖行政单位','');
四、建立区级表并增加数据
DROP TABLE IF EXISTS `areas`;
CREATE TABLE `areas` (
`id` int(11) NOT NULL auto_increment,
`areaid` varchar(20) NOT NULL,
`area` varchar(50) NOT NULL,
`cityid` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='行政区域县区信息表' AUTO_INCREMENT=3145 ;
插入数据:
利用sql语句建立全国省市区三级数据库的更多相关文章
- 利用SQL语句替换织梦DedeCms数据库内容
找到 然后把命令放在 执行即可,慎重执行 替换文章标题 UPDATE `dede_archives` SET `title`=replace(title,'我我我','你你你') 替换文章正文 UPD ...
- PHP如何通过SQL语句将数据写入MySQL数据库呢?
1,php和MySQL建立连接关系 2,打开 3,接受页面数据,PHP录入到指定的表中 1.2两步可直接使用一个数据库链接文件即可:conn.php <?phpmysql_connect(&qu ...
- 用SQL语句创建和删除Access数据库中的表;添加列和删除列
用SQL语句创建和删除Access数据库中的表;添加列和删除列 Posted on 2009-08-11 13:42 yunbo 阅读(1240) 评论(0) 编辑 收藏 用SQL语句创建和删除Acc ...
- Oracle中,利用sql语句中的函数实现保留两位小数和四舍五入保留两位小数
Oracle中,利用sql语句中的函数实现保留两位小数和四舍五入保留两位小数: select trunc(1.23856789,2) from dual round(m,n) 可以四舍五入 trunc ...
- eclipse利用sql语句对Oracle数据库进行操作
对Oracle数据库执行操作的sql语句中表名和列名都需用英文双引号("")括起来. 注(\为转义符) 1.插入数据 sql = "insert into \" ...
- 利用SQL语句(命令方式)创建数据库(以及句子解释)
create database 课程管理 //1:create database为SQL语句,用于创建数据库.执行完之后会创建一个新数据库及存储该数据库的文件,或从先前创建的数据库文件中附加数据 ...
- 利用SQL语句实现分页
1.概述 在网页中如果显示的数据太多就会占据过多的页面,而且显示速度也会很慢.为了控制每次在页面上显示数据的数量,就可以利用分页来显示数据. 2.技术要点 在SQL Server中要实现SQL分页,需 ...
- 利用"SQL"语句自动生成序号的两种方式
1.首先,我们来介绍第一种方式: ◆查询的SQL语句如下: select row_number() over (order by name) as rowid, sysobjects.[id] fro ...
- Sql语句在SqlServer中创建数据库、表格并添加约束
通过Sql语句来创建数据库与架构 创建数据库 数据库的创建首先是要引用主数据库的,需要在master数据库的环境下进行创建.大致的语法如下: -- 使用master数据库 use master -- ...
随机推荐
- 3D Computer Grapihcs Using OpenGL - 05 EBO
本节将采用两种方法绘制两个三角形. 先看第一种方法的代码 MyGlWindow.cpp #include <gl\glew.h> #include "MyGlWindow.h&q ...
- 安卓手机和ios手机上图片未设置宽度可能导致ios上图片贼小
处理方法: 设置固定宽度,高度自适应
- C/C++头文件的编写
在C语言的学习过程中,我们一般把所有的代码写在一个文件中.随着自身水平的提高,我们发现代码越写越长,代码行数越来越多,把一个工程的所有代码写在一个文件中让人看起开非常吃力.于是我们开始想把代码中的函数 ...
- Oracle诊断: 服务器启后,无法连接
Oracle 服务器启后,使用Toad 客户端连接oracle 时候,遇到下面的错误: oracle ORA-12514: TNS: no listener TNS: listener does no ...
- Why Use the Widget Factory?
https://learn.jquery.com/jquery-ui/widget-factory/why-use-the-widget-factory/ Writing jQuery plugins ...
- loj#6036 编码
分析 考虑trie+2sat 每次将?=0和?=1的分别插入 插入串时将这个点的选择状态和前缀的选择状态连关系边 注意串结束时建一个新点表示当前串 最后跑2sat即可 代码 #include<b ...
- 圆角Panel
using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostic ...
- 封装好日志的类 logging
import logging from logging import handlers class MyLogger(): def __init__(self,file_name,level='inf ...
- centos6.5搭建禅道
linux用一键安装包 简介:本文介绍如何在linux下面使用禅道一键安装包搭建禅道的运行环境. 一.安装 二.如何访问数据库 linux一键安装包内置了XXD.apache, php, mysql这 ...
- logstash异常
logstash异常 1 2 3 Unrecognized VM option 'UseParNewGC' Error: Could not create the Java Virtual Machi ...