SQL Students-1 I need help with code

It only needs the name of a major. The ID will be added automatically. Add the first major from the courses.csv file into the majors table. It’s a VARCHAR, so make sure to put the value in single quotes.

  1. The major is Database Administration

  2. Use the INSERT INTO and VALUES keywords

  3. Here’s an example: INSERT INTO <table_name>(<column_name>) VALUES(<value>);

  4. Type INSERT INTO majors(major) VALUES('Database Administration');

When i typed that, i got an error -unexpected token near (’
Can someone help me and explain what i am doing wrong?

Are you typing the SQL commands into the postgres prompt, or the bash prompt? It sounds like you might be trying to type these commands into a bash prompt.

If still not sure, send a screenshot of the command you types and where you typed it, and the error.

1 Like

Hi I need help with code too please.

Next, insert the first course from courses.csv into the courses table.

  1. Use the INSERT INTO and VALUES keywords

  2. View the details of the table with \d courses to see what it expects

  3. The course name is Data Structures and Algorithms

  4. Make sure to put VARCHAR values in single quotes

  5. Here’s an example: INSERT INTO <table_name>(<column_name>) VALUES(<value>);

  6. Type INSERT INTO courses(course) VALUES('Data Structures and Algorithms');

After I typed that, it kept prompting that The “courses” table should have the correct row added

Could someone please help and clarify what I am doing incorrectly?

Thanks!

yes! this is it! Thank you so much for your help.

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