ASP源码.NET源码PHP源码JSP源码JAVA源码DELPHI源码PB源码VC源码VB源码Android源码
当前位置:首页 >> 数据库 >> 其他数据库 >> sqlzoo练习答案--The JOIN operation

sqlzoo练习答案--The JOIN operation(3/5)

来源:网络整理     时间:2016-01-13     关键词:

本篇文章主要介绍了"sqlzoo练习答案--The JOIN operation",主要涉及到方面的内容,对于其他数据库感兴趣的同学可以参考一下: gameidmdatestadiumteam1team210018 June 2012National Stadium, WarsawPOLGRE10028 J...

SELECT team1,team2,player FROM game JOIN goal ON goal.matchid=game.id and goal.player like 'Mario%'

5、

The table eteam gives details of every national team including the coach. You can JOIN goal to eteam using the phrase goal JOIN eteam on teamid=id

Show playerteamidcoachgtime for all goals scored in the first 10 minutes gtime<=10

SELECT player, teamid, coach,gtime
  FROM goal inner join eteam on eteam.id=goal.teamid
 WHERE gtime<=10

6、

To JOIN game with eteam you could use either
game JOIN eteam ON (team1=eteam.id) or game JOIN eteam ON (team2=eteam.id)

Notice that because id is a column name in both game and eteamyou must specify eteam.id instead of just id

List the the dates of the matches and the name of the team in which 'Fernando Santos' was the team1 coach.

SELECT game.mdate,eteam.teamname FROM game inner join eteam on eteam.id=game.team1 and eteam.coach='Fernando Santos'

7、List the player for every goal scored in a game where the stadium was 'National Stadium, Warsaw'

select player from goal inner join game on game.id = goal.matchid and stadium='National Stadium, Warsaw'

相关图片

相关文章