I have a student_info.sh script:
#!/bin/bash
# Info about my computer science students from students database
echo -e "\n~~ My Computer Science Students ~~\n"
PSQL="psql -X --username=freecodecamp --dbname=students --no-align --tuples-only -c"
echo -e "\nFirst name, last name, and GPA of students with a 4.0 GPA:"
echo "$($PSQL "SELECT first_name, last_name, gpa FROM students WHERE gpa = 4.0")"
echo -e "\nAll course names whose first letter is before 'D' in the alphabet:"
echo "$($PSQL "SELECT course FROM courses WHERE course < 'D'")"
echo -e "\nFirst name, last name, and GPA of students whose last name begins with an 'R' or after and have a GPA greater than 3.8 or less than 2.0:"
echo "$($PSQL "SELECT first_name, last_name, gpa FROM students WHERE last_name >= 'R' AND (gpa > 3.8 OR gpa < 2.0)")"
echo -e "\nLast name of students whose last name contains a case insensitive 'sa' or have an 'r' as the second to last letter:"
echo "$($PSQL "SELECT last_name FROM students WHERE last_name ILIKE '%sa%' OR last_name ILIKE '%r_'")"
and i have a task: “Run the script to see the results.”
this is the result:
~~ My Computer Science Students ~~
First name, last name, and GPA of students with a 4.0 GPA:
Casares|Hijo|4.0
Vanya|Hassanah|4.0
Dejon|Howell|4.0
All course names whose first letter is before 'D' in the alphabet:
Computer Networks
Computer Systems
Artificial Intelligence
Calculus
Algorithms
First name, last name, and GPA of students whose last name begins with an 'R' or after and have a GPA greater than 3.8 or less than 2.0:
Efren|Reilly|3.9
Mariana|Russel|1.8
Mehdi|Vandenberghe|1.9
Last name of students whose last name contains a case insensitive 'sa' or have an 'r' as the second to last letter:
Gilbert
Savage
Saunders
Hilpert
Hassanah
so everything works, but i can’t go to the next task. I try even soft reset but didn’t work
What I have to do ?
Challenge: Build a Student Database: Part 2
Link to the challenge: