World Cup Database help

I am not sure why it is not passing my queries.sh script.

Here is my code.
#! /bin/bash

PSQL=“psql --username=freecodecamp --dbname=worldcup --no-align --tuples-only -c”

Do not change code above this line. Use the PSQL variable above to query your database.

echo -e “\nTotal number of goals in all games from winning teams:”

echo “$($PSQL “SELECT SUM(winner_goals) FROM games”)”

echo -e “\nTotal number of goals in all games from both teams combined:”

echo “$($PSQL “SELECT SUM(winner_goals + opponent_goals) FROM games”)”

echo -e “\nAverage number of goals in all games from the winning teams:”

echo “$($PSQL “SELECT AVG(winner_goals + opponent_goals) FROM games”)”

echo -e “\nAverage number of goals in all games from the winning teams rounded to two decimal places:”

echo “$($PSQL “SELECT ROUND(AVG(winner_goals),2) FROM games”)”

echo -e “\nAverage number of goals in all games from both teams:”

echo “$($PSQL “SELECT AVG(winner_goals) + AVG(opponent_goals) FROM games”)”

echo -e “\nMost goals scored in a single game by one team:”

echo “$($PSQL “SELECT MAX(winner_goals) FROM games HAVING MAX(winner_goals) > MAX(opponent_goals)”)”

echo -e “\nNumber of games where the winning team scored more than two goals:”

echo “$($PSQL “SELECT COUNT(game_id) FROM games WHERE winner_goals>2”)”

echo -e “\nWinner of the 2018 tournament team name:”

echo “$($PSQL “SELECT name FROM teams FULL JOIN games ON teams.team_id=games.winner_id WHERE year=2018 AND round=‘Final’ ORDER BY name ASC”)”

echo -e “\nList of teams who played in the 2014 ‘Eighth-Final’ round:”

echo “$($PSQL “SELECT DISTINCT(name) FROM teams INNER JOIN games ON teams.team_id=games.winner_id OR teams.team_id=games.opponent_id WHERE round=‘Eighth-Final’ AND year=2014 ORDER BY name ASC”)”

echo -e “\nList of unique winning team names in the whole data set:”

echo “$($PSQL “SELECT DISTINCT(name) FROM teams RIGHT JOIN games ON teams.team_id=games.winner_id ORDER BY name ASC”)”

echo -e “\nYear and team name of all the champions:”

echo “$($PSQL “SELECT year,name FROM teams FULL JOIN games ON teams.team_id=games.winner_id WHERE round=‘Final’ ORDER BY year ASC”)”

echo -e “\nList of teams that start with ‘Co’:”

echo “$($PSQL “SELECT name FROM teams WHERE name LIKE ‘Co%’”)”

Here is the expected outcome.

Total number of goals in all games from winning teams:
68

Total number of goals in all games from both teams combined:
90

Average number of goals in all games from the winning teams:
2.1250000000000000

Average number of goals in all games from the winning teams rounded to two decimal places:
2.13

Average number of goals in all games from both teams:
2.8125000000000000

Most goals scored in a single game by one team:
7

Number of games where the winning team scored more than two goals:
6

Winner of the 2018 tournament team name:
France

List of teams who played in the 2014 ‘Eighth-Final’ round:
Algeria
Argentina
Belgium
Brazil
Chile
Colombia
Costa Rica
France
Germany
Greece
Mexico
Netherlands
Nigeria
Switzerland
United States
Uruguay

List of unique winning team names in the whole data set:
Argentina
Belgium
Brazil
Colombia
Costa Rica
Croatia
England
France
Germany
Netherlands
Russia
Sweden
Uruguay

Year and team name of all the champions:
2014|Germany
2018|France

List of teams that start with ‘Co’:
Colombia
Costa Rica

Please help.

One of the answers with many zeros at the end needs to be truncated. You don’t appear to be limiting either of those.

It’s a bit tricky, carefully compare your output with the expected numbers (copy/paste them on the line right below so it’s easy to compare.)