Tell us what’s happening:
I am getting test runner error, while I am clicking the run button
Your code so far
#!/bin/bash
Script to insert data from courses.csv and students.csv into students database
PSQL=“psql -X --username=freecodecamp --dbname=students --no-align --tuples-only -c”
cat courses.csv | while IFS=“,” read MAJOR COURSE
do
#get major_id
MAJOR_ID=$($PSQL “SELECT major_id FROM majors WHERE major=‘$MAJOR’”)
echo $MAJOR_ID
#if not found
if [[ -z $MAJOR_ID ]]
then
# insert major
# get new major_id
fi
#get course_id
#if not found
#insert course
#get new course_id
#insert into majors_courses
done
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.44
Challenge: Learn SQL by Building a Student Database: Part 1 - Build a Student Database: Part 1
Link to the challenge: