MySQL中国省市区SQL表数据1.查省
SELECT * FROM china WHERE china.Pid=0
drop table if exists user2.查市
SELECT * FROM chinaWHERE china.Pid=330000
3.查区
SELECT * FROM china WHERE china.Pid = 330100
4.Mysql脚本
DROP TABLE IF EXISTS `china`;
CREATE TABLE `china` (
`Id` INT(11) NOT NULL,
`Name` VARCHAR(40) DEFAULT NULL,
`Pid` INT(11) DEFAULT NULL,
PRIMARY KEY  (`Id`),
KEY `FK_CHINA_REFERENCE_CHINA` (`Pid`),
CONSTRAINT `FK_CHINA_REFERENCE_CHINA` FOREIGN KEY (`Pid`) REFERENCES `china` (`Id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of china
-- ----------------------------
INSERT INTO `china` VALUES ('0', '中国', '0');
INSERT INTO `china` VALUES ('110000', '北京市', '0');
INSERT INTO `china` VALUES ('110100', '东城区', '110000');
INSERT INTO `china` VALUES ('110200', '西城区', '110000');
INSERT INTO `china` VALUES ('110500', '朝阳区', '110000');
INSERT INTO `china` VALUES ('110600', '丰台区', '110000');
INSERT INTO `china` VALUES ('110700', '⽯景⼭区', '110000');
INSERT INTO `china` VALUES ('110800', '海淀区', '110000');
INSERT INTO `china` VALUES ('110900', '门头沟区', '110000');
INSERT INTO `china` VALUES ('111100', '房⼭区', '110000');
INSERT INTO `china` VALUES ('111200', '通州区', '110000');
INSERT INTO `china` VALUES ('111300', '顺义区', '110000');
INSERT INTO `china` VALUES ('111400', '昌平区', '110000');
INSERT INTO `china` VALUES ('111500', '⼤兴区', '110000');
INSERT INTO `china` VALUES ('111600', '怀柔区', '110000');
INSERT INTO `china` VALUES ('111700', '平⾕区', '110000');
INSERT INTO `china` VALUES ('112800', '密云县', '110000');
INSERT INTO `china` VALUES ('112900', '延庆县', '110000');
INSERT INTO `china` VALUES ('120000', '天津市', '0');
INSERT INTO `china` VALUES ('120100', '和平区', '120000');
INSERT INTO `china` VALUES ('120200', '河东区', '120000');
INSERT INTO `china` VALUES ('120300', '河西区', '120000');
INSERT INTO `china` VALUES ('120400', '南开区', '120000');
INSERT INTO `china` VALUES ('120500', '河北区', '120000');
INSERT INTO `china` VALUES ('120600', '红桥区', '120000');
INSERT INTO `china` VALUES ('120900', '滨海新区', '120000');
INSERT INTO `china` VALUES ('121000', '东丽区', '120000');
INSERT INTO `china` VALUES ('121100', '西青区', '120000');
INSERT INTO `china` VALUES ('121200', '津南区', '120000');
INSERT INTO `china` VALUES ('121300', '北⾠区', '120000');
INSERT INTO `china` VALUES ('121400', '武清区', '120000');
INSERT INTO `china` VALUES ('121500', '宝坻区', '120000');
INSERT INTO `china` VALUES ('122100', '宁河县', '120000');
INSERT INTO `china` VALUES ('122300', '静海县', '120000');
INSERT INTO `china` VALUES ('122500', '蓟县', '120000');
INSERT INTO `china` VALUES ('130000', '河北省', '0');
INSERT INTO `china` VALUES ('130100', '⽯家庄市', '130000');
INSERT INTO `china` VALUES ('130101', '市辖区', '130100');
INSERT INTO `china` VALUES ('130102', '长安区', '130101');
INSERT INTO `china` VALUES ('130126', '灵寿县', '130100');  INSERT INTO `china` VALUES ('130127', '⾼⾢县', '130100');  INSERT INTO `china` VALUES ('130128', '深泽县', '130100');  INSERT INTO `china` VALUES ('130129', '赞皇县', '130100');  INSERT INTO `china` VALUES ('130130', '⽆极县', '130100');  INSERT INTO `china` VALUES ('130131', '平⼭县', '130100');  INSERT INTO `china` VALUES ('130132', '元⽒县', '130100');  INSERT INTO `china` VALUES ('130133', '赵县', '130100');  INSERT INTO `china` VALUES ('130181', '⾟集市', '130100');  INSERT INTO `china` VALUES ('130182', '藁城市', '130100');  INSERT INTO `china` VALUES ('130183', '晋州市', '130100');  INSERT INTO `china` VALUES ('130184', '新乐市', '130100');  INSERT INTO `china` VALUES ('130185', '⿅泉市', '130100');  INSERT INTO `china` VALUES ('130200', '唐⼭市', '130000');  INSERT INTO `china` VALUES ('130201', '市辖区', '130200');  INSERT INTO `china` VALUES ('130202', '路南区', '130201');  INSERT INTO `china` VALUES ('130203', '路北区', '130201');  INSERT INTO `china` VALUES ('130204', '古冶区', '130201');  INSERT INTO `china` VALUES ('130205', '开平区', '130201');  INSERT I
NTO `china` VALUES ('130207', '丰南区', '130201');  INSERT INTO `china` VALUES ('130208', '丰润区', '130201');  INSERT INTO `china` VALUES ('130223', '滦县', '130200');  INSERT INTO `china` VALUES ('130224', '滦南县', '130200');  INSERT INTO `china` VALUES ('130225', '乐亭县', '130200');  INSERT INTO `china` VALUES ('130227', '迁西县', '130200');  INSERT INTO `china` VALUES ('130229', '⽟⽥县', '130200');  INSERT INTO `china` VALUES ('130230', '唐海县', '130200');  INSERT INTO `china` VALUES ('130281', '遵化市', '130200');  INSERT INTO `china` VALUES ('130283', '迁安市', '130200');  INSERT INTO `china` VALUES ('130300', '秦皇岛市', '130000');  INSERT INTO `china` VALUES ('130301', '海港区', '130300');  INSERT INTO `china` VALUES ('130303', '⼭海关区', '130300');  INSERT INTO `china` VALUES ('130304', '北戴河区', '130300');  INSERT INTO `china` VALUES ('130321', '青龙满族⾃治县', '130300');  INSERT INTO `china` VALUES ('130322', '昌黎县', '130300');  INSERT INTO `china` VALUES ('130323', '抚宁县', '130300');  INSERT INTO `china` VALUES ('130324', '卢龙县', '130300');  INSERT INTO `china` VALUES ('130400', '邯郸市', '130000');  INSERT INTO `china` VALUES ('130401', '市辖区', '130400');  INSERT INTO `china` VALUES ('130402', '邯⼭区', '130401');  INSERT INTO `china` VALUES ('130403', '丛台区', '130401');  INSERT INTO `china` VALUES ('130404', '复兴区', '130401');  INSERT INTO `china` VALUES ('130406', '峰峰矿区', '130401');  INSERT INTO `china` VALUES ('130421', '邯郸县', '130400');  INSERT INTO `china` VALUES ('130423', '临漳县', '130400');  INSERT INTO `china` VALUES ('130424', '成安县', '130400');  I
NSERT INTO `china` VALUES ('130425', '⼤名县', '130400');  INSERT INTO `china` VALUES ('130426', '涉县', '130400');  INSERT INTO `china` VALUES ('130427', '磁县', '130400');  INSERT INTO `china` VALUES ('130428', '肥乡县', '130400');  INSERT INTO `china` VALUES ('130429', '永年县', '130400');  INSERT INTO `china` VALUES ('130430', '邱县', '130400');  INSERT INTO `china` VALUES ('130431', '鸡泽县', '130400');  INSERT INTO `china` VALUES ('130432', '⼴平县', '130400');  INSERT INTO `china` VALUES ('130433', '馆陶县', '130400');  INSERT INTO `china` VALUES ('130434', '魏县', '130400');  INSERT INTO `china` VALUES ('130435', '曲周县', '130400');  INSERT INTO `china` VALUES ('130481', '武安市', '130400');  INSERT INTO `china` VALUES ('130500', '邢台市', '130000');  INSERT INTO `china` VALUES ('130501', '市辖区', '130500');  INSERT INTO `china` VALUES ('130502', '桥东区', '130501');  INSERT INTO `china` VALUES ('130503', '桥西区', '130501');  INSERT INTO `china` VALUES ('130521', '邢台县', '130500');
INSERT INTO `china` VALUES ('130530', '新河县', '130500');  INSERT INTO `china` VALUES ('130531', '⼴宗县', '130500');  INSERT INTO `china` VALUES ('130532', '平乡县', '130500');  INSERT INTO `china` VALUES ('130533', '威县', '130500');  INSERT INTO `china` VALUES ('130534', '清河县', '130500');  INSERT INTO `china` VALUES ('130535', '临西县', '130500');  INSERT INTO `china` VALUES ('130581', '南宫市', '130500');  INSERT INTO `china` VALUES ('130582', '沙河市', '130500');  I
NSERT INTO `china` VALUES ('130600', '保定市', '130000');  INSERT INTO `china` VALUES ('130601', '新市区', '130600');  INSERT INTO `china` VALUES ('130603', '北市区', '130600');  INSERT INTO `china` VALUES ('130604', '南市区', '130600');  INSERT INTO `china` VALUES ('130621', '满城县', '130600');  INSERT INTO `china` VALUES ('130622', '清苑县', '130600');  INSERT INTO `china` VALUES ('130623', '涞⽔县', '130600');  INSERT INTO `china` VALUES ('130624', '⾩平县', '130600');  INSERT INTO `china` VALUES ('130625', '徐⽔县', '130600');  INSERT INTO `china` VALUES ('130626', '定兴县', '130600');  INSERT INTO `china` VALUES ('130627', '唐县', '130600');  INSERT INTO `china` VALUES ('130628', '⾼阳县', '130600');  INSERT INTO `china` VALUES ('130629', '容城县', '130600');  INSERT INTO `china` VALUES ('130630', '涞源县', '130600');  INSERT INTO `china` VALUES ('130631', '望都县', '130600');  INSERT INTO `china` VALUES ('130632', '安新县', '130600');  INSERT INTO `china` VALUES ('130633', '易县', '130600');  INSERT INTO `china` VALUES ('130634', '曲阳县', '130600');  INSERT INTO `china` VALUES ('130635', '蠡县', '130600');  INSERT INTO `china` VALUES ('130636', '顺平县', '130600');  INSERT INTO `china` VALUES ('130637', '博野县', '130600');  INSERT INTO `china` VALUES ('130638', '雄县', '130600');  INSERT INTO `china` VALUES ('130681', '涿州市', '130600');  INSERT INTO `china` VALUES ('130682', '定州市', '130600');  INSERT INTO `china` VALUES ('130683', '安国市', '130600');  INSERT INTO `china` VALUES ('130684', '⾼碑店市', '130600');  INSERT INTO `china` VALUES ('130685', '⽩沟新城县', '130600');  INSERT INTO `china` V
ALUES ('130700', '张家⼝市', '130000');  INSERT INTO `china` VALUES ('130701', '市辖区', '130700');  INSERT INTO `china` VALUES ('130702', '桥东区', '130701');  INSERT INTO `china` VALUES ('130703', '桥西区', '130701');  INSERT INTO `china` VALUES ('130705', '宣化区', '130701');  INSERT INTO `china` VALUES ('130706', '下花园区', '130701');  INSERT INTO `china` VALUES ('130721', '宣化县', '130700');  INSERT INTO `china` VALUES ('130722', '张北县', '130700');  INSERT INTO `china` VALUES ('130723', '康保县', '130700');  INSERT INTO `china` VALUES ('130724', '沽源县', '130700');  INSERT INTO `china` VALUES ('130725', '尚义县', '130700');  INSERT INTO `china` VALUES ('130726', '蔚县', '130700');  INSERT INTO `china` VALUES ('130727', '阳原县', '130700');  INSERT INTO `china` VALUES ('130728', '怀安县', '130700');  INSERT INTO `china` VALUES ('130729', '万全县', '130700');  INSERT INTO `china` VALUES ('130730', '怀来县', '130700');  INSERT INTO `china` VALUES ('130731', '涿⿅县', '130700');  INSERT INTO `china` VALUES ('130732', '⾚城县', '130700');  INSERT INTO `china` VALUES ('130733', '崇礼县', '130700');  INSERT INTO `china` VALUES ('130800', '承德市', '130000');  INSERT INTO `china` VALUES ('130801', '市辖区', '130800');  INSERT INTO `china` VALUES ('130802', '双桥区', '130801');  INSERT INTO `china` VALUES ('130803', '双滦区', '130801');  INSERT INTO `china` VALUES ('130804', '鹰⼿营⼦矿区', '130801');  INSERT INTO `china` VALUES ('130821', '承德县', '130800');  INSERT INTO `china` VALUES ('130822', '兴隆县', '130800');  INSERT INTO `china` VALUES ('130823', '平泉县', '130800');  INSERT INTO `china` VALUES ('130824', '滦平县', '130800');
INSERT INTO `china` VALUES ('130921', '沧县', '130900');  INSERT INTO `china` VALUES ('130922', '青县', '130900');  INSERT INTO `china` VALUES ('130923', '东光县', '130900');  INSERT INTO `china` VALUES ('130924', '海兴县', '130900');  INSERT INTO `china` VALUES ('130925', '盐⼭县', '130900');  INSERT INTO `china` VALUES ('130926', '肃宁县', '130900');  INSERT INTO `china` VALUES ('130927', '南⽪县', '130900');  INSERT INTO `china` VALUES ('130928', '吴桥县', '130900');  INSERT INTO `china` VALUES ('130929', '献县', '130900');  INSERT INTO `china` VALUES ('130930', '孟村回族⾃治县', '130900');  INSERT INTO `china` VALUES ('130981', '泊头市', '130900');  INSERT INTO `china` VALUES ('130982', '任丘市', '130900');  INSERT INTO `china` VALUES ('130983', '黄骅市', '130900');  INSERT INTO `china` VALUES ('130984', '河间市', '130900');  INSERT INTO `china` VALUES ('131000', '廊坊市', '130000');  INSERT INTO `china` VALUES ('131001', '市辖区', '131000');  INSERT INTO `china` VALUES ('131002', '安次区', '131001');  INSERT INTO `china` VALUES ('131003', '⼴阳区', '131001');  INSERT INTO `china` VALUES ('131022', '固安县', '131000');  INSERT INTO `china` VALUES ('131023', '永清县', '131000');  INSERT INTO `china` VALUES ('131024', '⾹河县', '131000');  INSERT INTO `china` VALUES ('131025', '⼤城县', '131000');  INSERT INTO `china` VALUES ('131026', '⽂安县', '131000');  INSERT INTO `china` VALUES ('131028', '⼤⼚回族⾃治县', '131000');  INSERT INTO `china` VALUES ('131081', '霸州市', '131000');  INSERT INTO `china` VALUES ('131082', '三河市', '131000');  INSERT INTO `china` VALUES ('131100', '衡⽔市', '130000');  I
NSERT INTO `china` VALUES ('131101', '市辖区', '131100');  INSERT INTO `china` VALUES ('131102', '桃城区', '131101');  INSERT INTO `china` VALUES ('131121', '枣强县', '131100');  INSERT INTO `china` VALUES ('131122', '武⾢县', '131100');  INSERT INTO `china` VALUES ('131123', '武强县', '131100');  INSERT INTO `china` VALUES ('131124', '饶阳县', '131100');  INSERT INTO `china` VALUES ('131125', '安平县', '131100');  INSERT INTO `china` VALUES ('131126', '故城县', '131100');  INSERT INTO `china` VALUES ('131127', '景县', '131100');  INSERT INTO `china` VALUES ('131128', '⾩城县', '131100');  INSERT INTO `china` VALUES ('131181', '冀州市', '131100');  INSERT INTO `china` VALUES ('131182', '深州市', '131100');  INSERT INTO `china` VALUES ('140000', '⼭西省', '0');
INSERT INTO `china` VALUES ('140100', '太原市', '140000');  INSERT INTO `china` VALUES ('140101', '市辖区', '140100');  INSERT INTO `china` VALUES ('140105', '⼩店区', '140101');  INSERT INTO `china` VALUES ('140106', '迎泽区', '140101');  INSERT INTO `china` VALUES ('140107', '杏花岭区', '140101');  INSERT INTO `china` VALUES ('140108', '尖草坪区', '140101');  INSERT INTO `china` VALUES ('140109', '万柏林区', '140101');  INSERT INTO `china` VALUES ('140110', '晋源区', '140101');  INSERT INTO `china` VALUES ('140121', '清徐县', '140100');  INSERT INTO `china` VALUES ('140122', '阳曲县', '140100');  INSERT INTO `china` VALUES ('140123', '娄烦县', '140100');  INSERT INTO `china` VALUES ('140181', '古交市', '140100');  INSERT INTO `china` VALUES ('140200
', '⼤同市', '140000');  INSERT INTO `china` VALUES ('140201', '市辖区', '140200');  INSERT INTO `china` VALUES ('140202', '城区', '140201');  INSERT INTO `china` VALUES ('140203', '矿区', '140201');  INSERT INTO `china` VALUES ('140211', '南郊区', '140201');  INSERT INTO `china` VALUES ('140212', '新荣区', '140201');  INSERT INTO `china` VALUES ('140221', '阳⾼县', '140200');  INSERT INTO `china` VALUES ('140222', '天镇县', '140200');  INSERT INTO `china` VALUES ('140223', '⼴灵县', '140200');  INSERT INTO `china` VALUES ('140224', '灵丘县', '140200');  INSERT INTO `china` VALUES ('140225', '浑源县', '140200');
INSERT INTO `china` VALUES ('140322', '盂县', '140300');  INSERT INTO `china` VALUES ('140400', '长治市', '140000');  INSERT INTO `china` VALUES ('140401', '市辖区', '140400');  INSERT INTO `china` VALUES ('140402', '城区', '140401');  INSERT INTO `china` VALUES ('140411', '郊区', '140401');  INSERT INTO `china` VALUES ('140421', '长治县', '140400');  INSERT INTO `china` VALUES ('140423', '襄垣县', '140400');  INSERT INTO `china` VALUES ('140424', '屯留县', '140400');  INSERT INTO `china` VALUES ('140425', '平顺县', '140400');  INSERT INTO `china` VALUES ('140426', '黎城县', '140400');  INSERT INTO `china` VALUES ('140427', '壶关县', '140400');  INSERT INTO `china` VALUES ('140428', '长⼦县', '140400');  INSERT INTO `china` VALUES ('140429', '武乡县', '140400');  INSERT INTO `china` VALUES ('140430', '沁县', '140400');  INSERT INTO `china` VAL
UES ('140431', '沁源县', '140400');  INSERT INTO `china` VALUES ('140481', '潞城市', '140400');  INSERT INTO `china` VALUES ('140500', '晋城市', '140000');  INSERT INTO `china` VALUES ('140501', '市辖区', '140500');  INSERT INTO `china` VALUES ('140502', '城区', '140501');  INSERT INTO `china` VALUES ('140521', '沁⽔县', '140500');  INSERT INTO `china` VALUES ('140522', '阳城县', '140500');  INSERT INTO `china` VALUES ('140524', '陵川县', '140500');  INSERT INTO `china` VALUES ('140525', '泽州县', '140500');  INSERT INTO `china` VALUES ('140581', '⾼平市', '140500');  INSERT INTO `china` VALUES ('140600', '朔州市', '140000');  INSERT INTO `china` VALUES ('140601', '市辖区', '140600');  INSERT INTO `china` VALUES ('140602', '朔城区', '140601');  INSERT INTO `china` VALUES ('140603', '平鲁区', '140601');  INSERT INTO `china` VALUES ('140621', '⼭阴县', '140600');  INSERT INTO `china` VALUES ('140622', '应县', '140600');  INSERT INTO `china` VALUES ('140623', '右⽟县', '140600');  INSERT INTO `china` VALUES ('140624', '怀仁县', '140600');  INSERT INTO `china` VALUES ('140700', '晋中市', '140000');  INSERT INTO `china` VALUES ('140701', '市辖区', '140700');  INSERT INTO `china` VALUES ('140702', '榆次区', '140701');  INSERT INTO `china` VALUES ('140721', '榆社县', '140700');  INSERT INTO `china` VALUES ('140722', '左权县', '140700');  INSERT INTO `china` VALUES ('140723', '和顺县', '140700');  INSERT INTO `china` VALUES ('140724', '昔阳县', '140700');  INSERT INTO `china` VALUES ('140725', '寿阳县', '140700');  INSERT INTO `china` VALUES ('140726', '太⾕县', '140700');  INSERT INTO `china` VALUES ('140727
', '祁县', '140700');  INSERT INTO `china` VALUES ('140728', '平遥县', '140700');  INSERT INTO `china` VALUES ('140729', '灵⽯县', '140700');  INSERT INTO `china` VALUES ('140781', '介休市', '140700');  INSERT INTO `china` VALUES ('140800', '运城市', '140000');  INSERT INTO `china` VALUES ('140801', '市辖区', '140800');  INSERT INTO `china` VALUES ('140802', '盐湖区', '140801');  INSERT INTO `china` VALUES ('140821', '临猗县', '140800');  INSERT INTO `china` VALUES ('140822', '万荣县', '140800');  INSERT INTO `china` VALUES ('140823', '闻喜县', '140800');  INSERT INTO `china` VALUES ('140824', '稷⼭县', '140800');  INSERT INTO `china` VALUES ('140825', '新绛县', '140800');  INSERT INTO `china` VALUES ('140826', '绛县', '140800');  INSERT INTO `china` VALUES ('140827', '垣曲县', '140800');  INSERT INTO `china` VALUES ('140828', '夏县', '140800');  INSERT INTO `china` VALUES ('140829', '平陆县', '140800');  INSERT INTO `china` VALUES ('140830', '芮城县', '140800');  INSERT INTO `china` VALUES ('140881', '永济市', '140800');  INSERT INTO `china` VALUES ('140882', '河津市', '140800');  INSERT INTO `china` VALUES ('140900', '忻州市', '140000');  INSERT INTO `china` VALUES ('140901', '忻府区', '140900');  INSERT INTO `china` VALUES ('140921', '定襄县', '140900');

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。