备注:所有查询基于前面章节中建立的中国数据库
```
/*联合查询*/
-- union
(select CityID,CityName from t_city where CityID between 6 and 10)
union
(select ProName,ProID from t_province where ProID between 6 and 10);
--查询中国共有多少地级市
select count(*) from t_city;
--查询河北省有多少地级市
select count(*) from t_city where ProID = (
select ProID from t_province where ProName = '河北省'
);
--统计各省地级市的数量
select ProID,count(CityID) from t_city
group by ProID;
--求每个省份中最大的城市ID
select ProID,max(CityID) from t_city
group by ProID;
--地级市最多的省份取前10名
select ProID,count(CityID) as cityCount from t_city
group by ProID
order by cityCount desc
limit 10;
--查询拥有区县最多的城市的前10名
select CityID,count(Id) as disCount from t_district
group by CityID
orde