Tell us what’s happening:
While attempting the task: ’ Your properties
table should have a type_id
foreign key column that references the type_id
column from the types
table. It should be an INT
with the NOT NULL
constraint’ (see screenshot)
New column was easily made using: alter table properties add column type_id int;
To add values into the new column (and later set the column to NOT NULL
) with 9 rows, I tried the following insert data code (insert into one specific column) which is somehow failing by trying to add values to multiple columns. Not sure how to resolve this.
Code so far
insert into properties(type_id) values(3),(3),(1),(1),(2),(3),(3),(3),(2);
Error upon code fail:
ERROR: null value in column "atomic_number" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null, 3).
Screenshot:
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Challenge: Periodic Table Database - Build a Periodic Table Database
Link to the challenge: