Sqlzoo练习11-join quiz
Join opetation
指的是不同的表之间通过某个相同的字段进行关联,从而进行查询操作。本文是对Join
操作的小测
练习
- You want to find the stadium where player ‘Dimitris Salpingidis’ scored. Select the JOIN condition to use:
找到DS球员得分的体育场
1 | select stadium |
- You JOIN the tables goal and eteam in an SQL statement. Indicate the list of column names that may be used in the SELECT line:
将goal和eteam表使用在SQL语句中,使用的字段可能有
1 | matchid, teamid, player, gtime, id, teamname, coach |
- Select the code which shows players, their team and the amount of goals they scored against Greece(GRE).
找出和德国对抗中进球的数量
1 | select player, teamid, count(*) |
- Select the result that would be obtained from this code
1 | select distinct teamid, mdate -- 结果中有两个字段 |
- Select the code which would show the player and their team for those who have scored against Poland(POL) in National Stadium, Warsaw.
选择出和POL在该体育场中得分的player、team
1 | select distinct player, teamid |
- Select the code which shows the player, their team and the time they scored, for players who have played in Stadion Miejski (Wroclaw) but not against Italy(ITA).
找出在这个体育场中不是和ITA对抗的球队player、teamid、gtime
1 | select distinct player, teamid, gtime |
- Select the result that would be obtained from this code
1 | select teamname, count(*) |