79.3k views
2 votes
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 the dates of the matches and the name of the team in which 'Fernando Santos' was the team1 coach.

User Tchaymore
by
6.9k points

1 Answer

6 votes

Final answer:

To find the match dates and team names where 'Fernando Santos' is the team1 coach, perform an SQL query joining the 'game' and 'eteam' tables and filter where 'Fernando Santos' is the coach of team1.

Step-by-step explanation:

To list the dates of the matches and the names of the teams where 'Fernando Santos' was the team1 coach, you would need to perform an SQL query joining the game table and the eteam table. Since 'Fernando Santos' is the coach of team1, you will need to ensure that the condition in your SQL query reflects the relationship where he is the coach. Here's an example query that could be used:

SELECT game.date, eteam.name
FROM game
JOIN eteam ON game.team1 = eteam.id
WHERE game.coach1 = 'Fernando Santos';

This SQL query selects the date of the match and the name of the team from the eteam table where the id matches the team1 field in the game table and 'Fernando Santos' is the coach of team1.

User Kaetzacoatl
by
8.0k points