Relational database. Learn sql by building a student database part 1. Build a student database part 1

Hi!

I was wondering if someone could help me understand why am I stuck in the part where the tutorial asks for including 9 comments in the insert_data.sh. I did it as it is says but for some reason the program tells me: Your script should have all the suggested comments added correctly. This is my program:

#!/bin/bash

#Script to insert data from courses.csv and students.csv into students database

cat courses.csv | while IFS="," read MAJOR COURSE
do
  # get major_id
 
  # if not found

  # insert major

  # get new major_id

  # get course_id

  # if not found

  # insert course

  # get a new course_id

  # insert into majors_courses

done

Thanks in advance!

it is hard to tell without seeing what step you are on. (maybe copy the instructions out?)

Here it is the step and the hits.

It helps to plan out what you want to happen. For each loop, you will want to add the major to the database if it isn’t in there yet. Same for the course. Then add a row to the majors_courses table. Add these single line comments in your loop in this order: get major_id, if not found, insert major, get new major_id, get course_id, if not found, insert course, get new course_id, insert into majors_courses.

  1. Here’s an example of a single comment: # <comment>

  2. Add the nine suggested single line comments, each on their own line, in the order given

  3. It should look like this:

do
  # get major_id

  # if not found

  # insert major

  # get new major_id

  # get course_id

  # if not found

  # insert course

  # get new course_id

  # insert into majors_courses

done

This one is not exactly matching the requested comment.

Please check each comment carefully in case this is not the only discrepancy

Okay it was just that. I guess I am just tired and unable to see the mistake.

Thank you!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.