Tell us what’s happening:
Describe your issue in detail here.
Hi,
I’ve been looking for a way to insert the teams into the database to start making the script, but I can’t find it. This is what basically I wanna do but with the opponents too.
If anyone can give me any advice I would appreciate it.
Your code so far
cat games.csv | while IFS=“,” read YEAR ROUND WINNER OPPONENT WINNER_GOALS OPPONENT_GOALS
do
TEAM=$($PSQL "SELECT name FROM teams")
for I in $TEAM
do
if [[ $WINNER != $I ]]
then
INSERT_TEAM=$($PSQL "INSERT INTO teams (name) VALUES ('$WINNER')")
echo $INSERT_TEAM
fi
done
done
Of course it has all the code that comes with the file initialy, but this is my part.
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36 Edg/101.0.1210.32
Challenge: World Cup Database - Build a World Cup Database
Link to the challenge: