sqlzoo
harveyzz
这个作者很懒,什么都没留下…
展开
-
sqlzoo第九部分错题及答案
stops(id, name)route(num, company, pos, stop)3.Give the id and the name for the stops on the ‘4’ ‘LRT’ serviceselect id,name from stops join route on route.stop=stops.idwhere num=4 and company='LRT'#有错误,但我自己找不到,想哭#8.Give a list of the services which原创 2020-07-30 23:31:10 · 413 阅读 · 0 评论 -
sqlzoo第八部分错题及答案
2.Note the INNER JOIN misses the teachers with no department and the departments with no teacher.SELECT teacher.name, dept.name FROM teacher INNER JOIN dept ON (teacher.dept=dept.id)3.Use a different JOIN so that all teachers are listed.SEL原创 2020-07-30 21:06:06 · 456 阅读 · 0 评论 -
sqlzoo第七部分错题及答案
電影數據庫此教程練習表格合拼。數據庫有三個表格movie電影(id編號, title電影名稱, yr首影年份, director導演, budget製作費, gross票房收入)actor演員(id編號, name姓名)casting角色(movieid電影編號, actorid演員編號, ord角色次序)12.尊·特拉華達’John Travolta’最忙是哪一年? 顯示年份和該年的電影數目。SELECT yr,COUNT(title) FROM movie JOIN casting ON原创 2020-07-30 13:48:39 · 944 阅读 · 0 评论 -
sqlzoo第五六部分错题及答案
8.列出有至少100百萬(1億)(100,000,000)人口的洲份。select continent from world group by continenthaving sum(population)>=100000000HAVING 子句对 GROUP BY 子句设置条件的方式与 WHERE 和 SELECT 的交互方式类似。WHERE 搜索条件在进行分组操作之前应用;而 HAVING 搜索条件在进行分组操作之后应用。HAVING 语法与 WHERE 语法类似,但 HAVING 可以原创 2020-07-28 20:44:49 · 990 阅读 · 1 评论 -
sqlzoo第四部分错题及答案
5.Germany德國(人口8000萬),在Europe歐洲國家的人口最多。Austria奧地利(人口850萬)擁有德國總人口的11%。顯示歐洲的國家名稱name和每個國家的人口population。以德國的人口的百分比作人口顯示。小數位數您可以使用函數ROUND 刪除小數。百分號 %select name,concat(ROUND(population/( select population from world where name='Germany')*100,原创 2020-07-26 23:01:45 · 1228 阅读 · 2 评论 -
sqlzoo第三部分错题及答案
查找尤金•奧尼爾EUGENE O’NEILL得獎的所有細節select * from nobelwhere winner='EUGENE O''NEILL'#字符有单引号,多打一个引号转义列出爵士的獲獎者、年份、獎頁(爵士的名字以Sir開始)。先顯示最新獲獎者,然後同年再按名稱順序排列。select winner,yr,subject from nobelwhere winner like 'Sir%'order by yr desc,winner#双层排序注意逗号14.Th...原创 2020-07-24 22:27:10 · 1848 阅读 · 0 评论 -
sqlzoo第二部分错题及答案
11.The CASE statement shown is used to substitute North America for Caribbean in the third column.Show the name - but substitute Australasia for Oceania - for countries beginning with N.SELECT name, CASE WHEN continent='Oceania' THEN 'Australasia'原创 2020-07-24 20:32:39 · 625 阅读 · 0 评论