Difference between revisions of "JOIN Quiz"
From SQLZOO
| (2 intermediate revisions by one user not shown) | |||
| Line 113: | Line 113: | ||
</div> | </div> | ||
<quiz shuffle=none display=simple> | <quiz shuffle=none display=simple> | ||
| − | { | + | {You want to find the stadium where player 'Dimitris Salpingidis' scored. Select the JOIN condition to use: |
|type="()"} | |type="()"} | ||
| − | - | + | - eteam JOIN game ON (id=team1) |
| − | - | + | - eteam JOIN game ON (id=team2) |
| − | + | - eteam JOIN goal ON (teamid=id) | |
| − | + | + game JOIN goal ON (id=matchid) | |
| − | - | + | - game JOIN goal ON (team1=teamid OR team2=teamid) |
| − | { | + | {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: |
|type="()"} | |type="()"} | ||
| − | - | + | - gtime, mdate, stadium, match.id |
| − | + | - mdate, stadium, id | |
| − | + | + matchid, teamid, player, gtime, id, teamname, coach | |
| − | - | + | - matchid, teamid, player, gtime, mdate, stadium, team1 |
| − | - | + | - stadium, team1, team2 |
{Select the code which shows players, their team and the amount of goals they scored against Greece(GRE). | {Select the code which shows players, their team and the amount of goals they scored against Greece(GRE). | ||
Latest revision as of 16:38, 29 September 2012
JOIN quiz
| id | mdate | stadium | team1 | team2 |
|---|---|---|---|---|
| 1001 | 8 June 2012 | National Stadium, Warsaw | POL | GRE |
| 1002 | 8 June 2012 | Stadion Miejski (Wroclaw) | RUS | CZE |
| 1003 | 12 June 2012 | Stadion Miejski (Wroclaw) | GRE | CZE |
| 1004 | 12 June 2012 | National Stadium, Warsaw | POL | RUS |
| ... | ||||
| matchid | teamid | player | gtime | |
|---|---|---|---|---|
| 1001 | POL | Robert Lewandowski | 17 | |
| 1001 | GRE | Dimitris Salpingidis | 51 | |
| 1002 | RUS | Alan Dzagoev | 15 | |
| 1001 | RUS | Roman Pavlyuchenko | 82 | |
| ... | ||||
| id | teamname | coach | ||
|---|---|---|---|---|
| POL | Poland | Franciszek Smuda | ||
| RUS | Russia | Dick Advocaat | ||
| CZE | Czech Republic | Michal Bilek | ||
| GRE | Greece | Fernando Santos | ||
| ... | ||||