문제 속 제시된 테이블 관계

 

 

01. 

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 player, teamid, coach, gtime for all goals scored in the first 10 minutes gtime<=10

 

풀이 코드

 

 

 

02.

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 eteam you must specify eteam.id instead of just id

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

 

풀이코드

 

 

 

03.

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

 

풀이 코드

 

 

04.

Show the stadium and the number of goals scored in each stadium.

 

풀이 코드

 

 

05.

For every match involving 'POL', show the matchid, date and the number of goals scored.

 

풀이 코드

 

 

06.

For every match where 'GER' scored, show matchid, match date and the number of goals scored by 'GER'

 

풀이 코드

 

 

 

-

SQLZOO는 처음 안 사이트인데 wiki 형식으로 되어 있는 곳이었다.

그래서 그런지 다른 사람이 푼 흔적이 그대로 남아 있어서 다 지우고 풀기 필수..

+ Recent posts