Hi there everyone, stuck here on the insert into - values and adding the names of the majors into my table - wondering if i messed something up along the way that is causing the issue or smth?
here is what I have so far
±---------±----------------------±----------±---------±-----------------------------------------+
| Column | Type | Collation | Nullable | Default |
±---------±----------------------±----------±---------±-----------------------------------------+
| major_id | integer | | not null | nextval(‘majors_major_id_seq’::regclass) |
| major | character varying(50) | | not null | |
±---------±----------------------±----------±---------±-----------------------------------------+
Indexes:
“majors_pkey” PRIMARY KEY, btree (major_id)
Referenced by:
TABLE “majors_courses” CONSTRAINT “majors_courses_major_id_fkey” FOREIGN KEY (major_id) REFERENCES majors(major_id)
TABLE “students” CONSTRAINT “students_major_id_fkey” FOREIGN KEY (major_id) REFERENCES majors(major_id)
postgres=> INSERT INTO majors(major) VALUES(‘Database Administration’);
INSERT 0 1
postgres=>
so as you can see above- this command isnt taking…if anyone could lend a hand, would really appreciate it! thanks alot.
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Challenge: Learn SQL by Building a Student Database: Part 1 - Build a Student Database: Part 1
No, the command from my friend the tutor on MCC says -
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.
see below for a partial list of the majors we are to input into the table…
major,course
Database Administration,Data Structures and Algorithms
Web Development,Web Programming
Database Administration,Database Systems
I just wasn’t sure where I was screwing up to get through the project is all, sorry if it was too vague-
I am getting the following error: Maybe this helps?
The “majors” table should have the correct row added
INSERT INTO majors(major) VALUES(‘Database Administration’); < This is the command that Code Road is asking for to get through to the next step.
Just was hoping you (or anyone else) could spot where the mistake is that is holding me up. Thanks again