Hi,
I am trying to add a column as per:
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
periodic_table=> ALTER TABLE properties ADD COLUMN type_id INT NOT NULL;
ERROR: column "type_id" contains null values
periodic_table=> SELECT * FROM properties;
atomic_number | type | atomic_mass | melting_point_celsius | boiling_point_celsius
---------------+-----------+-------------+-----------------------+-----------------------
1 | nonmetal | 1.008000 | -259.1 | -252.9
2 | nonmetal | 4.002600 | -272.2 | -269
3 | metal | 6.940000 | 180.54 | 1342
4 | metal | 9.012200 | 1287 | 2470
5 | metalloid | 10.810000 | 2075 | 4000
6 | nonmetal | 12.011000 | 3550 | 4027
7 | nonmetal | 14.007000 | -210.1 | -195.8
8 | nonmetal | 15.999000 | -218 | -183
1000 | metalloid | 1.000000 | 10 | 100
(9 rows)
periodic_table=> ALTER TABLE properties ADD COLUMN type_id INT NOT NULL;
ERROR: column "type_id" contains null values
periodic_table=>
getting this error?