本文主要是介绍6 JOIN Quiz-SQLZoo,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1. You want to find the stadium where player ‘Dimitris Salpingidis’ scored. Select the JOIN condition to use:
game JOIN goal ON (id=matchid)
2. 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:
matchid, teamid, player, gtime, id, teamname, coach
3. Select the code which shows players, their team and the amount of goals they scored against Greece(GRE)
SELECT player, teamid, COUNT(*)FROM game JOIN goal ON matchid = idWHERE (team1 = "GRE" OR team2 = "GRE")AND teamid != 'GRE'GROUP BY player, teamid
4. Select the result that would be obtained from this code:
SELECT DISTINCT teamid, mdateFROM goal JOIN game on (matchid=id)WHERE mdate = '9 June 2012'
5. Select the code which would show the player and their team for those who have scored against Poland(POL) in National Stadium, Warsaw
SELECT DISTINCT player, teamid FROM game JOIN goal ON matchid = id WHERE stadium = 'National Stadium, Warsaw' AND (team1 = 'POL' OR team2 = 'POL')AND teamid != 'POL'
6. 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)
SELECT DISTINCT player, teamid, gtimeFROM game JOIN goal ON matchid = idWHERE stadium = 'Stadion Miejski (Wroclaw)'AND (( teamid = team2 AND team1 != 'ITA') OR ( teamid = team1 AND team2 != 'ITA'))
7. Select the result that would be obtained from this code:
SELECT teamname, COUNT(*)FROM eteam JOIN goal ON teamid = idGROUP BY teamname
HAVING COUNT(*) < 3
这篇关于6 JOIN Quiz-SQLZoo的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!