题目如下:
这道题主要考联合查询。

Given the CITY and COUNTRY tables, query the names of all the continents (COUNTRY.Continent) and their respective average city populations (CITY.Population) rounded down to the nearest integer.
Note: CITY.CountryCode and COUNTRY.Code are matching key columns.
Input Format

答案如下:
SELECT SON,PARENT ,c.p FROM (SELECT A.N as son ,B.N as parent FROM BST A RIGHT JOIN BST B on A.P=B.N)
tmp join BST C ON tmp.parent =c.n
该博客探讨了一道SQL题目,涉及对CITY和COUNTRY表的联合查询,目的是查询每个大陆的名称及其平均城市人口(四舍五入到最接近的整数)。输入格式和答案示例也给出了具体的查询语句。内容侧重于SQL的联查操作和数据聚合函数的应用。
5万+

被折叠的 条评论
为什么被折叠?



